There are situations in which a family member occupied a rent-regulated unit and moved out, leaving it to a relative who continues to pay the rent. Or sometimes individuals marry and occupy an apartment with a spouse, then subsequently divorce, and the remaining party wasn't on the lease. These are just a couple examples of the wide variety of fact-specific situations that may or may not lend themselves to your retaining a tenancy, when at first you're not named on the lease.
In some of these cases, succession rights are involved, which is one of two methods to gain legal tenancy. As a "successor" tenant you may have a right to stay, even if you were not initially on the lease. The key determining factor is that you and a member of your immediate family must have lived there together, as your primary residence, for the most recent two years. If you have been co-occupants for at least two years, and the landlord attempts to evict you to deregulate the unit, or to jack up the rent, you may have a valid argument to continue living there...and not be subject to the landlord's illegal rent increase.
An important factor in all instances in which an occupant isn't named on the lease is this: if the rent is still paid in the name of the person who no longer lives there, it creates problems for the person in residency to become the legally "named tenant." It's usually preferable to pay the rent in your own name, with legitimate rights under the lease as a remaining family member or legal occupant. However, it's safest to review your particular facts with a Tenants' lawyer, before you send a check with a different name on it than the landlord is used to seeing. Otherwise, you'll likely get a set of eviction papers shortly thereafter, challenging your right to succeed to the lease.
The second method of becoming a legal tenant if you're not already named on the lease is if the landlord's actions have established a tenancy. These cases can be very complex and almost always involve litigation. Frequently, issues such as subletting , illusory tenancy and assignment of lease rights come up, among others.
The point is that almost every case of this sort has unique facts, and it is up to a judge to evaluate them and render a decision. Going to court is something of a horse race in all these scenarios, but with proper representation from an experienced Tenants' attorney, it is possible to win. So if you think there's a chance you may have rights to a rent-regulated apartment in New York City, which is a rare treasure nowadays, it's worth considering a consultation with an experienced lawyer.