When people ask me about the doctrine of indulgences, I remind them of the scenes in Matthew's Gospel where Christ gives Peter (16:19) and the rest of the Apostles (18:18) the "keys to the kingdom of heaven. Whatever you bind on earth shall be bound in heaven; and whatever you loose on earth shall be loosed in heaven". Christ himself gives the Church the authority to handle God's treasury on Earth: to teach Truth (in faith and morals), forgive sins, impose punishments, etc.
It is also the authority for the Church to be the treasurer of God's generosity for man, which Christ has merited for us; granting indulgences is part of this authority. Indulgences tap into the infinite riches of God's generosity and mercy that our finite minds cannot grasp. The parable of the workers in the vinyeard (Mt 20) shows us that God's generosity is beyond human understanding.
We have to understand sin in order to understand indulgences. The Catechism (#1471-1479) explains: "sin has a double consequence. Grave sin deprives us of communion with God and therefore makes us incapable of eternal life, the privation of which is called the 'eternal punishment' of sin. On the other hand every sin, even venial, entails an unhealthy attachment to creatures, which must be purified either here on earth, or after death in the state called Purgatory.
"This purification frees one from what is called the "temporal punishment" of sin. These two punishments must not be conceived of as a kind of vengeance inflicted by God from without, but as following from the very nature of sin. A conversion which proceeds from a fervent charity can attain the complete purification of the sinner in such a way that no punishment would remain.
"An indulgence is a remission before God of the temporal punishment due to sins whose guilt has already been forgiven, which the faithful Christian who is duly disposed gains under certain prescribed conditions through the action of the Church which, as the minister of redemption, dispenses and applies with authority the treasury of the satisfactions of Christ and the saints....An indulgence is partial or plenary according as it removes either part or all of the temporal punishment due to sin... The faithful can gain indulgences for themselves or apply them to the dead."
In our society, true justice calls for punishments to fit the crimes. It is the same with moral crimes (sins). While God forgives us of our sins in his Mercy, He calls us to make satisfaction for our offenses for the sake of Justice. One way is to serve a temporal ("in time") punishment in Purgatory. Another way to make satisfaction is by performing certain works of devotion, penance, and charity on Earth done in union with the Bride of Christ, the Church, in which we can gain indulgences. These are not ways to "buy" or "merit" salvation; they are experiences of the Grace of Christ. We experience for ourselves (and possibly for others) not only a true conversion of heart, but also the vast richness of God's mercy.
Check out this site for some "myths" about indulgences: