Indulgences can be plenary (full) or partial, and so remove either all or part of the temporal punishment due to sins.
Indulgences can be gained for yourself, or applied to the holy souls in purgatory, but not to another living person.
To gain an indulgence, you must be a baptized Catholic, not excommunicated, and not in a state of mortal sin at the time of the actions taken for the indulgence.
You must have the intention of gaining the indulgence, and perform the required actions in the required amount of time and in a devout manner.
You can gain many partial indulgences, but only one plenary indulgence per day, except that you can gain a second plenary indulgence at the point of death.
If the indulgence requires visiting a church or oratory, you should devoutly recite the Our Father and the Creed during the visit.
To gain a plenary indulgence, you must be free from all attachment to sin, even venial sin.
You must perform the required actions, receive Holy Communion, make a sacramental confession, and pray for the intentions of the Holy Father.
It is preferred that you receive communion and pray for the intentions of the Holy Father on the same day that you perform the actions, but within several days (about 20) before or after is acceptable. These must be performed for each indulgence sought.
Confession should be made within several days (about 20) before or after the actions for the indulgence. One confession can apply to many indulgences.
The usual prayers offered for the intentions of the Holy Father are one Our Father and one Hail Mary.
If all the conditions are not met, the indulgence becomes partial, rather than plenary.
Things that we are obliged to do, like Mass attendance, are understood to confer graces and are not enhanced with indulgences.
The content in this section has been adapted from the 1999 Manual of Indulgences, published by the Apostolic Penitentiary, as well as insights and practical advice found in the article How to Actually Gain Indulgences by Kendra Tierney, published on Catholic All Year (catholicallyear.com).