Leases help clarify who can do what between you and your landlord, but you have tenant’s rights even without a lease. That means that if you can prove that you have a relationship with the landlord by demonstrating things like:
- They knew you were living in the apartment and didn't say anything or try to make you leave;
- You were living in the rental at all for a certain amount of time
- They accepted rent from you.
In this situation, your legal status is called "tenancy at will." The point at which you officially become a tenant varies state by state. In New York, for example, you’re a tenant after thirty days of living in an apartment. The only way to get you to leave is to legally evict you, which means at least thirty days of notice must be provided. In any state, if you pay rent directly to the landlord you become a tenant and the same goes.
To understand your situation, barring specific guidance in your state, you can use common sense. If you’re staying with a friend for a defined period of time you’re probably a guest. If you lose your return ticket and start contributing to rent then you’re at at-will tenant, and locking you out or forcing you out at that point is actually illegal.