When in the past: als or wenn?
Use als for a single past event or a past period such as childhood. Use wenn for repeated occasions, present/future when, or if. Both put the finite verb at the end.
Understand the idea
English when covers several relationships that German distinguishes. Als usually introduces a single past occasion or a past period viewed as one setting. Wenn is used for repeated occasions and for many present/future time or conditional relationships.
Build it step by step
Establish whether the sentence describes one past event, a repeated situation or a condition. Words such as immer and jedes Mal help signal repetition. Both als and wenn introduce verb-final subordinate clauses in these uses. If the subordinate clause comes first, put the main-clause finite verb next.
See it in a sentence
Als ich ein Kind war, wohnte ich in Bonn.
Immer wenn es regnet, bleibe ich zu Hause.
A useful memory aid
Add a mental label before choosing the connector: once in the past, every time, or if/when in the present or future.
A common trap
Do not choose als merely because any past tense appears. A repeated past situation often needs wenn, while a single past setting can use als.