"When the bell rings" is an adverbial clause, specifying the time at which the students go to class.