Purgatory is that place, that process, by which our soul after death becomes suited for eternal life living in the new heavens and new earth. Contrary to the popular opinion of many, purgatory is taught in the Bible.
Here are examples of what occurs in purgatory...
Every thought and imagination has real substantive existence in the spiritual realm; you could say they are alive. Everything in the spiritual realm is alive: that is the defining characteristic of the spiritual realm where spirit = life.
Ultimately, in the new heavens and new earth, only things pleasing to God exist; everything else is banished for eternity to the lake of fire. The plan of redemption involves segregating things pleasing to God from things displeasing to God (he hates these).
God allowed for his created creatures to think thoughts and have imaginations and memories displeasing to him. These exist in a segregated bubble within the spiritual realm, separated from God's direct presence. Having original sin, our soul also resides within this bubble separated from God; this is the cloudy glass we see though darkly.
When Jesus died the sacrificial death on our behalf he took on judged sin as part of his nature. God can only look on sin if it has been judged — judged sin becomes holy. In fact, an essential aspect of sin is that God as Judge must judge it (but God did not create sin or evil). In receiving Christ's sacrifice for our sin, the souls of believers take on a new component, the Holy Spirit, as part of their nature. A new bubble of God's holiness appears and grows within our souls. These two aspects are at war, these two bubbles each seeking to overwhelm the other.
Santification and purgatory are two aspects of the same thing: santification occurs while we are alive, purgatory after we have died.
The process is as follows: we have attachments to various thoughts, ideas, imaginations, and memories. Not only that, our mind keeps manufacturing these — it is very active. Because of original sin, not everything the mind manufactures pleases God.
Believers are to please God. This involves sifting through all these thoughts, ideas, imaginations, and memories, and rejecting those displeasing to God. Some are recurring; confronted with it again and again we must reject it again and again.
The Catholic Church teaches (but I doubt it's true) those who are martyred for their faith have no need for purgatory; they have already given up the greatest attachment, the attachment to life. All lesser attachments are subsumed under this one. Those redeemed who have died but who are not consigned to purgatory reside somewhere else in the spiritual realm close to Christ, free from the intrigues of the wicked spirits.
I suppose you could say that hell (hades) is the same kind of place as purgatory; a similar but reverse process occurs. Since those in hell have chosen to reject Christ who presented himself in full glory to them at their death, they will one by one reject all aspects of goodness and godliness. As they review one by one their thoughts and memories, the wickedness of all the other spiritual garbage they have chosen to keep will repulse the good.
At the great white throne judgment we will finally see the results of the process of santification and purgatory for the redeemed, and of anti-purgatory in hell for the eternally damned. For the unredeemed, nothing good and godly will remain; why would God cast anything of himself into the Lake of Fire? Before anyone can be cast into the Lake of Fire they must be purged of all goodness, holiness, purity, and godliness.
The phrase "temporal effects of sin" refers to aspects of the sin which do not affect ultimate salvation. Examples are, the harm caused to someone else and the habit formed by committing the sin. The temporal effects of sin result in temporal punishment. No one can truly pay the full price so at some point God intervenes and forgives even this.
For those who doubt that there is such a thing as temporal punishment, you can prove it indeed is true by examining the long train of cause and effect originating from your sin. The mental anguish we have from recognizing that we've harmed someone is a form of temporal punishment. In fact, purgatory is a lot like that: we are confronted with the harm our sins have caused and we grieve over it and ask God to somehow make it all right.
Jesus paid the penalty for our sins so that we can be forgiven and redeemed. But the Bible is clear that we must, ourselves, pay the price for the damage to ourselves and others caused by our sins.