If you have a lease, the new owner must honor the lease unless s/he wants to move in as his/her residence. If the new owner wants to move in or if you are renting month-to-month, the new owner must give you at least 90 days written notice to move out.
This is not legal advice and does not create an attorney-client relationship. The information about is a general statement of the law. Reviewing a case and giving legal advice to a client requires more information than can be exchanged in this format. If you need legal advice, contact an experienced tenants' attorney.