I had no idea that the Catholic Church continued to do this. NY Times has an interesting article.
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.