As a tenant in a property that was foreclosed you are protected by the Protecting Tenants at Foreclosure Act. Please see my legal guide regarding the protecting tenants at foreclosure act at the link below.
You must continue to pay the new owner the rent.
You should file a copy of your written lease agreement with the clerk of courts.
On the upper right hand corner of the lease agreement, write in the case number
of the foreclosure case. Mail a copy to all of the parties (the bank/mortgage company,
the former owner, etc.)
The new owner can give you a notice that he wants you to leave by 90 days after you receive the notice. If you have a written lease agreement that is for a term like a year, then the new owner has to honor it unless he intends to live in the property himself.
If the new owner tries to use a Writ of Possession from the foreclosure case, you will need to put in a Motion to Stay the Writ of Possession based on the fact that you are a tenant.
You may need to see a local landlord tenant lawyer asap.
Normally the new owner takes possession of the home subject to the lease as long as they had proper notice. You may want to record your lease to make sure that any subsequent owners are put on notice. If your lease is a month to month lease the new owner can of course provide you adequate notice that they do not wish to renew the lease and will be able to evict you.