Okay, first things first: a man does not have an obligation to divorce his wife. However, if he chooses to divorce his wife, he must do so by giving her a formal document that we call a “get.”
The entire concept of a get is one of balance. Some religions prohibit divorce, forcing couples to stay in an unhappy relationship. Other religions permit a man to divorce his wife with a verbal declaration alone, making it too easy to do in the heat of an argument. Through a get, a couple is able to dissolve a union that isn't working out but only after due consideration. Additionally, the get provides documentation that a woman is divorced, so that others should not suspect her of immorality.
While only a man can grant a divorce, the woman can petition for divorce. Under certain conditions, beis din will compel a man to grant a divorce against his will (see Talmud Yevamos 106a).
This mitzvah applies in all times and places. It is the subject of the Talmudic tractate of Gittin. It is codified in the Shulchan Aruch in Even Ha’Ezer 119. This mitzvah is #222 of the 248 positive mitzvos in the Rambam’s Sefer HaMitzvos; it is not listed in the Chofetz Chaim’s Sefer HaMitzvos HaKatzar.