当 + [clause] + 的时候,+ [clause]
当 + [clause] + 时,+ [clause]
当 opens a "when" clause that …的时候 closes. The whole frame comes before the main clause, which says what happened at that moment.
…的时候 can do the same job alone; adding 当 makes the sentence more careful and a little more formal. 当…时 is the written version, common in articles and instructions.
当 can't introduce the clause alone. Without 的时候 or 时 it doesn't mean "when".
English lets "when" come at the end. Here the time frame goes before the main clause.