Depends on if you're the owner. If not, do you have a lease as the renter?
The law states you have 90 days to receive notice prior to being evicted from a foreclosure. Also, neither the landlord nor the bank is legally obligated to let the tenant know about the foreclosure (in a rental situation.)
If you have a lease, the owners (whoever they are or become) are obligated to allow you to remain in the property until the lease expires with three exceptions:
1. The lease can be terminated on 90 days notice if the unit is sold to a purchaser who will occupy the property.
2. The lease has fewer than 90 days remaining.
3. The tenancy is month-to-month or a tenancy at-will, in which case the new owners must provide the tenant with 90 days notice prior to eviction.
If you've been served notice, you have 90 days. If the new owners are unaware, and they try to force you out early, tell them about The Protecting Tenants in Foreclosure Act. PTFA was passed by Congress signed into law by the President in May, 2009 and expires December 31, 2014. (S.896, P.L. 111-22)
If you're the owner of the home, and the home has gone to auction, your time is up. If you have no issue with the sheriff knocking on the door and physically removing you, stay until that happens if it means keeping a roof over your head. Otherwise the bank may offer you an incentive for leaving early and keeping everything in top working order.