You can pay to stay at the Salvation Army for as long as you need to stay. But others also the Salvation Army are free but you must check with them about how long you can stay. If you join a program, then you will be there for about a year or more.
Not sure if you have to pay but the longest I've heard of anyone staying was 1 month.
Thanks! Your answer is awaiting moderation.