New York limits residential security deposits to one month's rent under the Housing Stability and Tenant Protection Act of 2019, with a 14-day return deadline.
This is information, not legal advice.
Rules change, and how they apply depends on your property and your tenancy.
Read the official source for yourself, and talk to an attorney in your state
before you rely on anything here.