[clause] + 的时候,[clause]
[noun] + 的时候,[clause]
的时候 turns a clause into a time phrase meaning "when" or "while". The "when" part goes first and ends in 的时候; the main clause follows.
English can put "when…" at the end of the sentence. The 的时候 phrase has to go before the main clause.
When the two clauses have different subjects, each keeps its own, usually with a comma between.
的时候 also goes after a noun or a short verb phrase for an occasion.
的时候 means the two things overlap in time. For "after", use 以后.
的时候 can't ask a question. "When?" is 什么时候.