Maintenance (other states use the term "alimony") is determined by a number of issues relating to a marriage. It may be temporary or permanent.
Although it is not a given right to either spouse, the courts will generally order a certain amount of spousal support based on the following factors (this is a non-exhaustive list): duration of the marriage, income of both spouses, age of both spouses, health/special needs of either spouse, circumstances surrounding spousal support are unique to each couple, and therefore the court uses its discretion when determining maintenance orders.
In most cases, attorneys' fees for matters surrounding maintenance are paid for by the spouse with the higher income. Indeed, in 2010, New York passed statutes making interim maintenance & counsel fees presumptively awarded on all cases involving a higher-earning spouse versus a lower-earning spouse.
Additionally, as with child support orders, a maintenance order may be modified if the court can be shown there has been a substantial change of circumstances in the life of either party involved (though if there was a valid written agreement such as a "stipulation of settlement" or "separation agreement," the standard to modify may be "unanticipated change of circumstances").
See also: http://www.nycourts.gov/divorce/calculator.pdf
How is maintenance (i.e., "alimony") awarded in a New York Divorce case?
by David Bliven on Aug. 10, 2013
Summary
Maintenance formula