While it may very well feel like your freshman roommate or Aunt Zelda are overstaying their welcome, the law doesn't necessarily limit how long they can crash chez vous. That said, your landlord or board might. Here, the rules for hosting long-term guests in New York:
Non-paying guests are welcome. Under New York State law, residents can have house guests stay for as long as they want. It's also legal to rent out a spare room, if you plan to live in the apartment at the same time. What's not legal: Renting out your space for fewer than 30 days when you're not going to be there (which is why Airbnb is a problem in NYC).
Renters, check your leases. Some landlords will add guest-related clauses to their leases that say they have to be notified if someone stays more than 30 days, and they can deny the request. Some are even stricter about time limits.
Owners and shareholders, check with the board. Some buildings turn a blind eye, some limit guests to the one-month mark, and some have detailed rules that are strictly enforced. A lot will probably depend on how disruptive your guests are, so if it's a quiet couple, you should be fine. A family of six with two dogs? Not so much. Whether or not you tell your board in advance is your call, but remember that if there is a policy in place and you break it you can, in theory, face fines.
Brick Underground articles occasionally include the expertise of, or information about, advertising partners when relevant to the story. We will never promote an advertiser's product without making the relationship clear to our readers.