You get out of purgatory when God’s Grace has perfected the Soul to be in the presence of God since nothing not in a perfect state of Grace can be in God’s presence in heaven.
I don’t know about paying indulgences, as I said, Indulgences are tied to penance, which has to follow the Sacrament of Confession. So and indulgence most be ex post Confession, not ex ante, for it to be valid.
I feel sorry for folks like you that cannot see that Christ took care of all your guilt on the cross. What can you possibly do to make Christs work complete? The Catholic Church ( and other churches that emphasize works) rob sinners of the confidence that Christ did it all for those who believe. It is a GIFT to those that believe. You are a doubter because you have been taugt that what Christ did is not enough. Read John 3:16 and believe.