New York law (RPL 235-f) allows a tenant of any private residential apartment to share their apartment with their immediate family members, one additional occupant and any dependent children of that occupant so long as the apartment is the tenant's primary residence, so long as there is only one tenant on the lease.
If there are two or more tenants on the lease the law allows occupancy by the tenants named on the lease, immediate family of tenants, but doesn't allow for another occupant not on the lease. One caveat is that if one or more of the tenants on the lease moves out, the moving tenant or tenants can be replaced by roommates. For example, if there are four tenants named on the lease and two of them move out, the two tenants remaining in the apartment can take have two new roommates move in.
The roommate law has several restrictions. New York law does not permit the number of occupants to exceed the number of tenants, and each person residing in the apartment must have a livable area of at least 80 square feet. The square footage count does not include bathrooms, closets or hallways. A tenant should also provide the landlord the name of any occupants of the apartment within 30 days of the occupant moving in. Contact Rozen Law Group if you believe your landlord has unjustifiably denied you the right to have a roommate.