For foreclosures on or after May 20, 2009, the successor in interest (bank in your case) assumes title subject to:
(1) the provision, by such successor in interest of a notice to vacate to any bona fide tenant at least 90 days before the effective date of such notice; and
(2) the rights of any bona fide tenant, as of the date of such notice of foreclosure--
(A) under any bona fide lease entered into before the notice of foreclosure to occupy the premises until the end of the remaining term of the lease, except that a successor in interest may terminate a lease effective on the date of sale of the unit to a purchaser who will occupy the unit as a primary residence, subject to the receipt by the tenant of the 90 day notice under paragraph (1); or
(B) without a lease or with a lease terminable at will under State law, subject to the receipt by the tenant of the 90 day notice under subsection (1),
Reference: the Protecting Tenants at Foreclosure Act (Title VII, PL 111-22). The federal law supercedes state law, unless state law offers longer time periods or additional protections.
If the property was foreclosed, you're protected for a minimum of 90 days or through the term of your lease, whichever is longer. Of course, you're free to accept cash for keys and move. It's up to you.
For more information, check out the Renters in Foreclosure Toolkit at [url=http://www.nlihc.org/template/page.cfm?id=227]NLIHC: Renters in Foreclosure Toolkit[/url].