The deal will provide continued health care on the site, but under a new operator.
SUNY will be allowed to exit operations of the facility in Cobble Hill, Brooklyn, by this May, and bids will be taken to find a new operator.
The agreement ends all pending and future litigation, while providing an agreed upon process to deliver a viable long-term health care solution for the community.
"Today's agreement is a victory for all parties involved and paves the way for putting a long-term, sustainable health care facility in place for the residents of Brooklyn," Cuomo said in a statement. "We are in the midst of a health care transformation here in New York State, and the reality is that yesterday's costly, inefficient models of delivering service are no longer viable options for tomorrow. Under the terms of today's agreement, SUNY is reopening the solicitation process to find a new operator for LICH that will guide the facility as it modernizes and continues its important mission of serving New Yorkers."
The State University of New York board oversees the hospital and has been trying to close it and sell it.
In his previous office as public advocate, Mayor Bill de Blasio had joined other opponents in litigation to halt the sale.
Under the agreement announced Thursday, an expedited bidding process will be used to find a new owner. The deal must be approved by SUNY trustees and by the court.
Bidders will be required to offer medical care at the site but it was not immediately clear whether they would have to run a full-service hospital as community activists have demanded.
The agreement will allow SUNY to cease operating Long Island College Hospital by this May. Cuomo said the hospital has been losing an "unsustainable" $13 million a month.
"We are in the midst of a health care transformation here in New York state, and the reality is that yesterday's costly, inefficient models of delivering service are no longer viable options for tomorrow." Cuomo said.
De Blasio said proposals for the future of the hospital must ensure that the health care needs of the community are met.
He added, "There is more work ahead, but we are closer than ever to the long-term, sustainable solution all of us have sought."
(The Associated Press contributed to this report)