There are several ways to return from Purgatory. The most common one is called Purgatory Standard Resurrection Procedure, or simply PSRP.
If a resurrection site is nearby, and there is someone willing to transport the body there (even League troopers have been known to drag dead Imperial soldiers to Resurrection sites in neutral zones), the deceased may follow the standard resurrection process:
Upon death, the Spark enters Purgatory and takes a place in the Line of the Purged -- a somewhat metaphysical queue of lost souls awaiting return.
Time in Purgatory is unclear and subjective, but in the material world, resurrection typically takes 1 to 7 days.
When the Spark reaches the front of the line and the body is available at a resurrection site, the resurrection occurs naturally and costs the usual price.
If the body is not available, the Spark remains in Purgatory, “hanging out” with other Sparks, until the body is ready, at which point the return is immediate.