At the risk of sounding like a recording, please consider getting a copy of
Catholicism for Dummies… It will answer many of your questions about the Catholic faith with straight, easily understood answers.
I see no direct connection at all to purgatory in these verses. But, as to the concept of a cleansing of residual sin after death, we know that nothing unclean enters God’s Kingdom. We know that we die with some level of sin on our souls - through our own fault. That sin must be cleansed before we may enter. Read
1 Corinthians 3:11-15. Please consider what Paul is speaking of: Salvation on the day of judgment, but only as though you are escaping through fire. Think of that. The refiner’s fire, where impurities are removed from gold.
Let us consider the case of the worlds best neurosurgeon. Fully trained, experienced, and practiced in his vocation. Scheduled to operate on a given day. Yet, doctor cannot enter the purity of the operating room until being scrubbed and cleansed of impurity. No one may simply walk in, no matter how qualified they otherwise are. There is a process that they must go through, even though they are scheduled to enter the operating room. This is due to physical impurity, but spiritual impurity applies in the spiritual realm of God’s Kingdom.
As to the Kingdom of Heaven, Jesus opened the gates. However, God is not limited in this regard. Yet, Jesus descended to the dead on Good Friday and preached the Gospel to the dead, whose spirits were in prison. This is ministry. You cannot minister to those who are already damned - they have no hope. Yet, the souls who heard the Gospel were not in Heaven, either. So, where, or what is this “prison”?
Compare this to the parable that Jesus taught in
Luke 12:58-59. He again speaks of a debt, or grievance, and unless you are reconciled, you will be in prison until you have paid your debt. Yet, even those who owe a debt eventually get out of prison. Jesus is not a lawyer - he is not giving legal advice, but rather spiritual advice so that we may stay out of spiritual prison.