You don't have to move out until you receive a written notice to vacate AFTER the foreclosure sale. Even then if you don't move out the lender has to file what is known as an ejectment action to have the Sheriff physically remove you and your stuff. This could be months or even years after you receive the forclosure notice. If you don't move out AFTER the foreclosure sale voluntarily you are giving up your one year right or redemption which would allow you to buy the home back if you came up with the whole amount within one year of the foreclosure. If you want to keep the home you should speak with an experienced bankruptcy lawyer about chapter 13 and see if its a possibility.
A notice of foreclosure just means the mortgage company is planning to foreclose. This is the first stage of foreclosure. The second stage is the actual foreclosure sale. The third stage is the filing of a lawsuit to "eject" or "evict" you from your home. Take a look at the resources below for more information on this.
If the mortgage company has done anything wrong (and if your loan was made in the last ten years this is very likely) then you can fight back against the foreclosure. Either sue to stop it or countersue after you are sued for eviction.
If you are foreclosed, you have 10 days to leave or you will lose your right of redemption - your ability to buy the house back within one year. If you are sued for ejectment, you need to answer the lawsuit or work it out with the mortgage company.
Bottom line is if you want to stay in your home and if the mortgage company does not really own the loan (a huge problem for loans in the last 10 years) or if the mortgage company has tacked on bogus fees, charges, etc. or lied to you, then you have options.
Feel free to contact me if you have any further questions and best wishes.