(a) When a landlord has been granted recovery of the premises under clause (1) or (2) of subsection (a) of section 840 of this title, the court, on application of the occupant, shall stay the issuance of an order of eviction for a reasonable period of not more than 6 months at a time, if, upon the application, it appears that—
(1) the applicant, although he has made due and reasonable efforts to secure suitable premises, cannot secure them; or
(2) by reason of other facts, it would occasion extreme hardship to the applicant or his family if the stay is not granted; and
(3) the application is made in good faith.
(b) A stay under subsection (a) of this section, if granted, shall be on condition that the tenant or occupant shall make a deposit in court for the period of the stay or pay to the landlord or deposit in court installments equivalent to the reasonable rental rate for which he would be liable. Such amounts shall also include all accrued rents unpaid by the occupant prior to the period of the stay.