Let's first look at the reverse problem, because this is a frequent mistakes in the notebook entries I correct.
There are two translations for English "when", "wenn" and "als".
You use "wenn" for a condition. Whenever you can use "if" in English instead of "when", the translation should be "wenn".
You use "als" for a point in time, when an action happened once, and a second action follows. In this case, you can't replace "when" by "if".
German very strictly destinguishes between those two. English "when" can mean both. That's why you can translate German "wenn" both into "when" and "if".
In general, you should eventually try to think in the language you are learning, and understand the meaning directly, instead of trying to explain the meaning in a different language. German and English are quite similar, but often enough the meanings and expressions differ.