Use when for one specific point in time, and it needs a main clause with it. Call me when you land.
If the when clause comes first, add a comma: When you land, call me. The comma disappears if the main clause leads.
You're telling someone about a moment that happened in the middle of something longer. He was walking home when he heard an explosion. Both words fit this pattern: the single event that interrupts takes when, and the longer background activity usually takes a continuous verb. For this moment, the dedicated when vs while comparison decides between the two words.
You're recalling a specific point from someone's past. She was in a bad car accident when she was young. When pins the event to that period, so the listener knows exactly where in time it sits.
You're sure something will happen and you're talking about what follows it. I'll call you when I finish work. You're certain the finish is coming, so when fits. If you're not certain it will happen, you need if instead: If I finish work early, I'll call you.
You're describing one single event cutting into the middle of a longer activity. Put when with the interrupting event and keep the longer activity in a continuous verb: He was walking home when he heard an explosion. You may also meet sentences like this worded with while, since the two overlap in some uses; the dedicated when vs while comparison sorts out which one your sentence needs.
Watch the timing in your own sentence. When with a past verb reports a finished moment: I dropped my phone when I got out of the taxi. Swap to a future certainty and when still works, but the verbs shift: I'll text you when I get out of the taxi. The moment stays fixed in both cases, so you're marking a point in time either way, not a stretch of time.