In New York City, a landlord must give written notice to a tenant to vacate the property. If there is a lease, the lease will usually have a provision determining what kind of notice must be given, how long a time period the notice must state, and how it must be served.
If there is no lease, the tenancy is usually a month-to-month tenancy. In this case, a 30 day notice of termination must be served. Normally, it terminates the tenancy on the last day of a month.
An occupant may not be a tenant. They can be a licensee or squatter. Either of these must be served with a 10 day notice to quit.
There are two exceptions to the requirement that an occupant must be served a written notice to vacate. One is if a lease has expired, and no new rent has been accepted. The other is if an occupant has been in an apartment for less than 30 days.
In all the above cases, a landlord must take the occupant to court before they can be evicted. No self-help evictions are allowed.