Dear New York Tenant:
If you moved out, and your lease did not expire or otherwise end, and you retained the keys, your tenancy is alive, the landlord cannot take possession of the apartment or change the locks.
If the lease expired but you retained the keys, the landlord cannot feel safe without a statement of voluntary surrender. You may consult an attorney to learn whether your landlord will be satisfied by the return of the keys.
The answer provided to you is in the nature of general information. The general proposition being that you should try to avoid a bad outcome if you can.
Your landlord wants the surrender so it is clear that he can enter and relet the apartment. As a rent stablilized tenant, you have rights in a continued occupancy and a guaranteed renewal, and the Landlord wants proof that you are not going to insist on these rights in the future.
Your landlord wants this to protect him or her in re renting. However, you should negotiate everything at once--the return of your security deposit, your landlord's agreement that s/he will not charge you rent for the remainder of the lease and any other outstanding issues between you. If there are any serious outstanding issues (such as your plans to sue him in upcoming months over the time you broke your leg on the ice on his sidewalk last winter), you should allow an attorney to help you in drafting something. Otherwise, you should just be sure to get those two items--secuirity deposit and waiver of future rent--in the agreement.