Generally, the automatic stay takes effect immediately upon filing your case and it lasts until you receive your discharge. Stays against actions against property you own may last longer or shorter depending on what happens to that property during your case (i.e. whether the Trustee sells it).

Caution:
• If your case is dismissed for whatever reason, the stay terminates within 30 days after dismissal unless you can show cause to extend the stay.
• If your Chapter 7 case is dismissed for abuse, the stay does not go into effect at all when you subsequently file a Chapter 11 or Chapter 13 case unless and until the court allows it after a hearing.
• If you had a bankruptcy case dismissed under any chapter within one year prior to the filing of your present case, the automatic stay will terminate 30 days after your new case is filed, unless you obtain a court order extending it, for cause and a showing of good faith as to why the prior case was dismissed.
• If you had more than one bankruptcy case dismissed under any chapter within one year prior to the filing of your present case, the automatic stay will not go into effect at all unless and until the court allows it after a hearing.