Three distinct contexts: (1) primary/secondary school — "kept after class as punishment," the "detention" sense; (2) university — "
留校任教" means a top graduate is hired by their alma mater as faculty, a prestigious outcome; (3) holidays — staying on campus rather than going home, common for distant or international students.