Vicky, it's hard to pinpoint an exact time frame as to how much time you'll be able to stay in your home as it varies according to your Lender, Attorney and their case files, I'm seeing; 6 months is an average time.
Why is it that you think your home won't sell? I recommend that you work with a Realtor qualified in Listing Short Sales as that can make a huge difference in whether or not your home is sold as a short sale. If your home is priced for your market, you should have a good chance of selling your home as there are buyers seeking good opportunities that come with a Short Sale. I'd hope for the best in selling your home.
Another good option for you that will stall the foreclosure process and give you more time to sell your home is to contact an Attorney in your area who can represent you and defend you against the foreclosure. You'll have to pay for his services which from my experience can run about $500/month.
However, in the event that your home isn't sold and it is foreclosed on, the time remaining in your home can run between 30-60 days without much notice given at all. So if you get to that point, you should plan on finding a new place to live right at that time.