Your sentence is correct, but I would use after : After the students had finished their work, they closed their books. com has the following definitions for the conjunction when : conj. At the time that: in the spring, when the snow melts.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.