It is generally up to the owner of the apartment, although individual municipalities i.e. Counties, Towns, Villages etc. may establish guideliens. Call your County Clerk, and then if you live in a village, the Village Clerk to see if there are any such requirements,
I represent a landlord of a multi apartment building in Rockland. I don't know if it differs by the size of the apartment building (which I highly doubt), but I am not aware of any county ordance governing this issue. I would look to the terms of the lease. In the lease, it may not be based strictly on number, but on nuisance value or noise issues.
All information provided by me on this site is general in nature. No attorney client relationship is created by participation on this site. No attorney/client privilege attaches to any communication on this site.