The Catholic doctrines of penance, purgatory, and indulgences are often very difficult for Protestants and other non-Catholics to wrap their minds around. For Protestants, especially, there has been a lot of prejudice surrounding these doctrines that have made them particularly difficult to understand. But I think that if we are willing to listen and think more carefully and deeply about these doctrines, we can see that they are not really all that strange. They make a lot of sense of the principles of Scripture as well as of human psychology and life.
I have found that making an analogy to family life has been helpful for my own internalizing of these ideas:
Imagine a pretty ordinary family. There are Mom and Dad, and there are two children--Sarah and Michael. One day, Sarah and Michael are playing, and Sarah hits Michael. Mom scolds Sarah, and asks her to apologize to Michael. Sarah does so, and seems sincere. Michael accepts her apology. However, Sarah has been doing a lot of this sort of thing lately--in fact, this is the third time she has hit Michael that day--and so Mom also tells Sarah she will not be allowed to play with a particular favorite toy for the rest of the afternoon because of what she did. It is good that Sarah has apologized and been forgiven, but she still needs to be disciplined for her behavior. A little later, Sarah, out of a desire to make things up to her Mom, voluntarily decides to clean her room. Mom finds out about this, and out of respect and pleasure towards what Sarah has done, she declares that Sarah's punishment is mitigated--she can have her toy earlier than was originally planned. Or, alternatively, imagine that her brother Michael, feeling sorry for her and wanting to help, asks Mom to let her have her toy earlier than was planned. Mom, out of pleasure over Michael's compassion for his sister, and wanting to honor that, agrees to mitigate Sarah's punishment and tells the repentant Sarah that her punishment is being mitigated on Michael's behalf.
All of this makes a lot of sense in terms of ordinary family dynamics. But interwoven into this story are analogies for the Catholic doctrines of penance, purgatory, and indulgences. When Sarah repents of hitting Michael and asks for forgiveness, and receives it from Michael, this is analogous to a sinner repenting of his sin and asking for God's forgiveness and receiving God's forgiveness. This forgiveness is granted entirely on the basis of Christ's merits. However, although Sarah is fully forgiven, her behavior still needs discipline to adequately correct it. She may be repentant, but her behavior has been hurtful and warrants a response that will help her realize more deeply its seriousness. Also, she needs to feel some consequences in order to help her move away from her tendency to continue to engage in the behavior. It is not that she is not fully forgiven, but that the consequences of her behavior and tendencies must be taken seriously and dealt with. Analogously, when a sinner truly repents and asks for God's forgiveness, turning from his sin to God through the power of God's grace, he is fully forgiven on the spot. If he dies that moment, he is on his way to heaven (including, by the way, if through no fault of his own he cannot make it or has not yet made it to sacramental confession). He is a friend of God, and hell cannot touch him. However, he may still have to face certain temporary, or temporal, consequences of his sin. When he confesses his sin and receives forgiveness sacramentally through the pronouncement of the priest (John 20:21-23), the priest may also prescribe to him certain penances which he must engage in in order to help him to face the seriousness and the consequences of his behavior, to make up for that behavior on a temporal level, and/or to help train him to avoid such behavior in the future. In this way, being joined to Christ, we "suffer with him" (Romans 8:17) so that we might be glorified with him. We die to sin with Christ so that we might live and reign with him (Romans 6, 8). The satisfaction and righteousness of Christ, given to repentant sinners as a free gift, is worked out in their lives as they put to death the deeds of the flesh and learn to live in righteousness.
But what happens if we die without having been adequately trained or purified? We are still bound for heaven, but part of the process of getting there must involve the completion of the training and purging process. This is called, in Catholic doctrine, purgatory. Sarah cannot get her toy back until Mom is satisfied with her "penance." Our penances are not always completed in this lifetime, and so sometimes we must be saved "as through fire," as St. Paul puts it (1 Corinthians 3:10-15).
Sarah's punishment was mitigated by Mom. In the first scenario, this was because Sarah spontaneously decided to clean her room out of a desire to help her mother. In the second scenario, this was because Michael, her brother, made a compassionate request that her sister's punishment be mitigated. Similarly, a sinner may have his penances mitigated by some extra-ordinary act of charity, or even by God's accepting someone else's charitable act or request on his behalf, as God honors such acts (assuming an appropriate repentant attitude in the sinner). This is the essence of the Catholic doctrine of indulgences. The Church, having the authority and responsibility to retain or remit sins and to prescribe or remit penances, can, in appropriate circumstances, grant mitigations of certain temporal penalties or consequences of sins based on certain acts or intentions or requests of the penitent sinner himself or of other saints in the communion of saints.
Keeping these analogies and explanations in mind, you might go back and study further the Catholic teaching regarding the doctrines of penance, purgatory, and indulgences. You might start with the Catechism of the Catholic Church's discussion of these subjects here and here. You can also find here, here, and here, further helpful resources on these topics.
Published on the feast of St. John Neumann