All grammarA2
wenn
The rule
In a clause with wenn the conjugated verb goes to the end, and when the wenn clause comes first, the main clause starts with its verb.
wenn has two meanings. Whenever: something happens again and again. If: a real condition, now or later. A comma separates the wenn clause from the main clause.
When the wenn clause comes first, it fills position 1, so the main clause starts with its verb: Wenn ich Zeit habe, lese ich die Zeitung. Not: Wenn ich Zeit habe, ich lese …
For one single time in the past German uses als instead, which comes at B1.
Examples
Ich lese die Zeitung, wenn ich Zeit habe.
I read the newspaper when I have time.
Ich rufe dich an, wenn du willst.
I'll call you if you want.
Wenn es regnet, fahre ich mit dem Bus.
When it rains, I take the bus.