Can the prime tenant throw me out?
No. If you have been living in the room for at least 30 days or have a signed rental agreement, you have tenancy rights.
The prime tenant will have to take you to court to evict you in a holdover case.
It is illegal for the prime tenant to change the locks on you. You can call the police and ask them to help you get back in. If they refuse, go to your borough housing court and file an illegal lockout case.
What if I am renting a room from someone in public housing, subsidized housing or with a section 8 voucher?
In public or subsidized housing, only people on the lease should be residing in the apartment. Family members can ask to be added. Usually roommates are not allowed. If you are a roommate in this situation, the primary tenant has to evict you as a tenant. They cannot lock you out if you have been there more than 30 days.