Sacred Heart of Jesus - 300 days Indulgence Medal
Front and back
An indulgence is defined as "the remission before God of the temporal punishment due for sins already forgiven as far as their guilt is concerned." The first thing to note is that forgiveness of a sin is separate from punishment for the sin.
Through sacramental confession we obtain forgiveness, but we aren't let off the hook as far as punishment goes.
Indulgences are two kinds: partial and plenary.
A partial indulgences removes part of the temporal punishment due for sins. A plenary indulgence removes all of it. This punishment may come either in this life, in the form of various sufferings, or in the next life, in purgatory. What we don't get rid of here we suffer there.
To receive a partial indulgence, you have to recite the prayer or do the act of charity assigned. You have to be in the state of grace at least by the completion of the prescribed work. The rule says" at the completion" because often part of the prescribed work is going to confession, and you might not be in the state of grace before you do that.
The other thing required is having a general intention to gain the indulgence. If you perform the required act but don't want to gain the indulgence, obviously you won't gain it.
The requirements for a plenary indulgence are tougher than for a partial. After all, a plenary indulgence remove all the temporal punishment due for the sins committed up to that time.
(If you sin later, of course, the temporal punishment connected with the new sins isn't covered by the earlier plenary indulgence, but, at least the punishment for the old sins isn't revived.)
"To acquire a plenary indulgence," says the Enchiridion, "it is necessary to perform the work to which the indulgence is attached and to fulfill the following three conditions: sacramental confession, Eucharistic Communion, and prayer for the intention of the Sovereign Pontiff. It is further required that all attachment to sin, even venial sin, be absent."
(Conditions for An Indulgence Taken from Catholic Online)