Use when for the time something happens — a single point, a short action, or a general/regular time.
when: at the time something happens
I'll call you when I arrive. (at that point)
When the alarm goes off, I get up. (every time — a regular moment)
She was happy when she heard the news. (a short moment)
Try it: The film finished, and that's when you left. Which fits? (When the film ended, we went home. / While the film ended, we went home. / Until the film ended, we went home.) Answer: When the film ended, we went home. — "The film ended" is a single point, and going home happened at that point, so use when. "While" needs a longer action for something to happen during, but ending is a moment, not a stretch. "Until" would mean you kept going home the whole time up to the end, which isn't something you can do over and over.
while: during a longer action
Use while for something that happens during a longer action, at the same time as it.
While I was cooking, the phone rang. (during the cooking)
Don't text while you're driving. (during the drive)
It started to rain while we were walking home. (during the walk)
Try it: Amina was in the middle of a long shower. During that time, someone knocked at the door. Which fits something during the longer action? (Someone knocked while she was showering. / Someone knocked as soon as she was showering.) Answer: Someone knocked while she was showering. — The knock came during the long shower, at the same time, so use while: while she was showering. "As soon as" would mean the knock came the instant she started, but it just happened sometime during it.
when vs while
when = a point or short action (or a general time); while = a longer, ongoing action — something is in progress and another thing happens during it.
When I saw her, I waved. (two quick points)
While I was reading, I fell asleep. (during the long reading)
When the train stopped, everyone stood up (a point) — while we were traveling, we played cards (a long stretch).
Try it: Diego spent a long time painting the fence. During that ongoing work, his neighbor walked past and said hello. The hello came during the long painting. Which fits better? (His neighbor said hello while Diego was painting. / His neighbor said hello when Diego was painting.) Answer: His neighbor said hello while Diego was painting. — Painting is a longer, ongoing action and the hello happened during it, so while fits best: while Diego was painting. We'd use when for a single point, like "when Diego finished".
as soon as: the very moment
Use as soon as for something that happens immediately, the very moment another thing happens, with no gap.
Call me as soon as you arrive. (the moment you get there)
As soon as the bell rang, the children ran out.
I'll text you as soon as I hear back.
Try it: Lars wants Mei to phone him the very instant her train pulls in, not a minute later. Which fits something that happens immediately? (Phone me as soon as you arrive. / Phone me while you arrive.) Answer: Phone me as soon as you arrive. — He wants the call the very moment she arrives, so use as soon as: as soon as you arrive. "While you arrive" doesn't work, arriving is a single moment, not a stretch of time to do something during.
after a time word, use the present for the future
After when, while, as soon as, until, before, after, use the present for future meaning — not will. The will goes in the other half of the sentence.
I'll call you when I arrive. (not "when I will arrive")
We'll wait until the rain stops. (not "until the rain will stop")
As soon as she gets home, she'll cook dinner. (not "as soon as she will get")
Try it: After a time word like when or as soon as, the future uses the present. Which is right? (I'll call you when I arrive. / I'll call you when I will arrive. / I'll call you when I arrived.) Answer: I'll call you when I arrive. — After when (and while, as soon as, until), use the present even for the future: when I arrive. "When I will arrive" doubles up the future (will is already in the other half), and "when I arrived" is the past, not the future.