They learned it at the academy; Sasuke started using it after the Timeskip because he'd drastically increased his speed (and tbh, it's sortof one of those "plot" moves that exists to demonstrate a difference in character strength; one person gets to "blitz" another by catching them off guard).
Naruto started using it after he learned Sage Mode (but, again, only used it at "dramatic" moments like destroying a Pain body, or attacking Kisame after first entering KCM, etc.).
It's one of the most overhyped techniques, precisely because it exists to create "hype" around a character's speed (and, in doing so, give rise to an inference of superior skill/power overall).
Even when a Shunsin is countered, the purpose of showing the Shunsin was to show another Shinobi's superior speed/power (case-in-point, Juubidara claiming Minato's last arm).