Time clauses with "als" and "wenn"

Subordinate clauses are dependent upon main clauses or another dependent clause. They cannot stand on their own. Often they begin with certain words (subordinating conjunctions, relative pronouns or question words) that connect them to the main or independent clause.

"als" and "wenn" are conjunctions that introduce temporal subordinate clauses. They serve to give a time context to the message conveyed in the clause to which they refer. Temporal clauses answer the question "Wann?" (when?). "als" and "wenn" indicate that the actions described in both clauses happen at the same time, but there is a difference between the two conjunctions.

Use "als" to describe one-time events or actions in the past.

Example:
Was ist passiert? — Wann?
Was ist passiert, als du im Wald warst?
(= What happened at that particular point in time?)

Use "wenn" for events in the past and future (sometimes for events in the present, too). In the past tense, "wenn" subordinate clauses refer to recurring events or processes. In the future tense they can refer to one-off or recurring events.

Example (past):
Anna hat gearbeitet. — Wann?
Anna hat gearbeitet, wenn sie Geburtstag hatte.
(= Anna didn't work on her birthday just once; she regularly works when it's her birthday.)

Example (future):
Bringst du mir einen Kaffee mit? — Wann?
Bringst du mir einen Kaffee mit, wenn du in die Kantine gehst?
(= I'd like a coffee. Not right this minute, but at some point in the future when you go to the cafeteria.)

Immer wenn
Often the adverb "immer" is added to temporal clauses with "wenn" that refer to recurring events and actions. If the subordinate clause precedes the independent clause, then "immer" directly precedes "wenn". But if the independent clause comes first, then the "immer" has to be incorporated into the independent clause.

Examples:
Anna hat immer gearbeitet, wenn sie Geburtstag hatte.
Immer wenn sie Geburtstag hatte, hat Anna gearbeitet.
Auch: Wenn sie Geburtstag hatte, hat Anna immer gearbeitet.

Subordinate clauses with "als" and "wenn" are always separated from the independent clause by a comma.