there is not set period of time, the foreclosure will remain on your credit for years after the foreclosure. You should be able to get mortgages shortly after but they will not be conventional and will probably be held by individuals not institutions. The more years that pass the better your credit score if you are paying bills on time and being a good steward of your money...
stop foreclosure