to make a student stay at school after normal hours as a punishment
keep sb after
Definitions from the Oxford Advanced Learner's Dictionary, 9th edition