The soul leaves immediately upon death
I'm going to quote the DMG, p. 24, under "Bringing Back the Dead", but the section before that quoted in Goopbgone's answer:
When a creature dies, its soul departs its body, leaves the Material Plane, travels through the Astral Plane, and goes to abide on the plane where the creature's deity resides. If the creature didn't worship a deity, its soul departs to the plane corresponding to its alignment.
That sure sounds to me that the soul departs the body when it dies, that is to say right away.
I can imagine that the journey of the soul through the Astral Plane to where it will eventually abide might take some time, so perhaps if it's shortly after death the soul would still be on the Astral Plane. But regardless, I can't see a reading that would allow for the soul to remain in the body while the body was dead.
Revivify can only be cast on a creature which has died. There may be some disagreement on whether one applies the next part of the "Bringing Back the Dead" rules that say that all returning from the dead requires the soul to approve of it, or whether one sees revivify as an exception to that general rule, but either way I think it's clear that the soul would have left the body by that point in order for it to be able to be reunited.
As further evidence that the soul has left the body already even if used within the time limit of revivify, the Tomb of Annihilation introduction says:
Any spell that breathes life into the dead (including revivify, raise dead, resurrection, and true resurrection) automatically fails if cast on a humanoid whose soul is either trapped in the Soulmonger or has been devoured by the atropal…