Use when + -ing when the -ing action and your main verb share the same subject. When reading, keep your phone on silent works because you're the one reading.
- If the subjects differ, don't shorten it. Switch to a full clause instead, like When you read, the phone should stay silent.
Situations where it works
Writing instructions or rules for someone: if the same person does both actions, the short form fits. When writing the report, check each figure twice means the reader both writes and checks.
Leaving yourself a reminder, like a note on your desk. The subject is still you, so the short form stays natural. When travelling, carry a paper copy of your passport works because you travel and you carry.
Warning someone kindly, with the main action in the -ing verb. When leaving the lab, close all the windows is fine because the same person leaves and closes.
Describing someone else's habit to them. The subject still matches, so you can keep it short. When cooking rice, don't lift the lid addresses the one person who cooks and lifts.
One contrasting case: don't shorten it if the subjects differ. The phone can't read, so When reading, the phone should stay silent misfires; keep the full clause instead.
When the subjects differ
One thing decides whether the short form fits: both actions must belong to the same subject. If you're telling someone what to do while they do it, When signing the form, print your name clearly works, because the signer is also the one printing.
If the subjects don't match, switch to a full clause with you or the person named. When booking online, the site crashed sounds like the site was booking. Say When I was booking online, the site crashed instead, and the timing stays clear. The longer version is always safe, so there's no penalty for keeping the full clause.