According to church teaching, even after sinners are absolved in the confessional and say their Our Fathers or Hail Marys as penance, they still face punishment after death, in Purgatory, before they can enter heaven. In exchange for certain prayers, devotions or pilgrimages in special years, a Catholic can receive an indulgence, which reduces or erases that punishment instantly, with no formal ceremony or sacrament.
There are partial indulgences, which reduce purgatorial time by a certain number of days or years, and plenary indulgences, which eliminate all of it, until another sin is committed. You can get one for yourself, or for someone who is dead. You cannot buy one — the church outlawed the sale of indulgences in 1567 — but charitable contributions, combined with other acts, can help you earn one. There is a limit of one plenary indulgence per sinner per day.