Any time you are on someone else’s property, whether originally as an invitee or not, and refuse to leave when asked you are committing criminal tresspass
Schools are different. Unless expelled by the district, the student by law must be there unless picked up by a parent or guardian. The minor student cannot be pushed out mid-day onto the street by a teacher with no guardian to receive the student. And I don't think criminal would be down to the specific room.
-PJ