Probably around 20-30 minutes after it's landed. Perseverance needs to lock onto sattelites that are part of the Deep Space Network for the bandwidth required to send media. It also takes 22 minutes to send a command and get a response back.
It was already communicating with DSN the whole way down, via one of the orbiters, and "send a pic" was apparently a pre-programmed command not requiring Earth initiation.
Probably routed through the Mars Reconnaissance Orbiter, Maven and possibly Europe's Mars Express satellites, rather than a direct connection to the Deep Space Network
If I understood the livestream correctly, it's because they were able to (maintain|quickly establish) lock to the MRO after touch-down and zip a couple of images up through the "bent-pipe" UHF-to-high-power relay into the Deep Space Network.