During the rainy season, i.e. three months, approximately July, august, September (depending on lunar months), monks aren't allowed to sleep outside their temple and cannot defrock. This tradition is coming from old times when Buddha stayed in temples during rainy season to avoid killing insects or growing seeds. It is a period for study, meditation and to teach new monks. They are allowed to go out during the day but they must sleep in the same temple every night during three months.