If you have a lease, it is valid and nothing will change except that you will have to deal with people who come to look at it. They will need to give you notice however and the lease says how much time, usually 48hrs notice. You might need to be concerned about getting your security deposit back. The new owner will be responsibile for that, but if it does not sell, you might not get it back.
If the property goes to foreclosure, and that process can take about 1 year, the bank might buy you out of the lease just to get you out or they can go to court and get you evicted by either the shorter of 1. the end of the lease or 2. 4 months from when they go to court. In affect, they can break the lease if your lease is longer than 4 months from when they go to court. However, they usually will offer to give you some $$$ to get out early and avoid all that. You might start looking for a new home. The market tends to favor the tenant so you should have some choices.