The original source of the rumor appears to be this article from the UK's Guardian, which is rather vague about its source. Father James Martin, SJ, wrote this pleasingly snarky piece that does briefly what I'm going to try to do in a little more detail. A concise explanation of the doctrine of indulgences can be found here, but not everybody finds the Catechism very readable, so I'm going to try a more colloquial way of discussing it.
"What do you want me to do? Leave? Then they'll keep being wrong!"*
1. What's an Indulgence?
To answer this question, we must first have a clear understanding of the effects of sin. Sin has a twofold result: eternal separation from God, and also temporal consequences here on earth. Those temporal consequences, which can be many and varied, include things like the 'equal and opposite reaction' that every action has (if you get really furious and punch a wall, your hand will hurt, and that is a natural consequence of losing your temper); and also a kind of fraying of the fibers of the soul -- because every act has the possibility of producing a habit, so that when we do something, we weaken our resistance to doing it again another time. Additionally, because we tend to rationalize things we've already done, sin often results in a clouding of our judgment -- we don't want to admit that we've done wrong, so we half-consciously confuse ourselves.
Forgiveness, which we receive in the sacraments of Baptism and Confession, means that our souls are reunited with God. The eternal consequences of sin are done away with by absolution; we are put back into a right relationship with God.
But the natural or temporal effects of sin aren't the same thing. God often leaves those to happen, as a means of disciplining, teaching, and purifying us. A parent doesn't stop loving a child who has done wrong, and if the child says sorry, the parent forgives; but the child may still be grounded, or have to do extra chores. The relationship is restored but the consequences aren't abolished, or not necessarily.
We have a specific Biblical example of this in the case of David (II Samuel 11.26-12.19). After his adultery with Bathsheba and effective murder of her husband, and the cover-up of both crimes, he is rebuked by the prophet Nathan. David, overcome with remorse, repents, and immediately, Nathan tells him, "The Lord also has put away your sin; you shall not die. Nevertheless, because by this deed you have utterly scorned the Lord, the child who is born to you shall die." The prophet specifically says that the sin has been forgiven; but the temporal consequences, in this case very terrible ones, remain.**
What an indulgence is, is release from the temporal consequences of a sin that has already been forgiven. If you do something wrong and get grounded, but then your parents change their mind and decide to waive the punishment, that is the same sort of thing as an indulgence. Or, in King David's case, when he asked God to spare the child's life, he was asking for an indulgence.
2. Fine, But Who Says the Church Can Dole Indulgences Out?
Short answer: Jesus. The passage is so well known from debates between Catholics and Protestants that many Christians could recite it almost in their sleep: You are Peter [i.e. Rock], and on this rock I shall build My Church, and the gates of Hell shall not prevail against it. And I shall give you the keys of the kingdom of Heaven, and whatever you bind on earth shall be bound in Heaven, and whatever you loose on earth shall be loosed in Heaven. I've heard and read a number of attempts to explain or explain away Christ's statement that St. Peter is the rock upon which the Church will be built; interestingly, I don't think I've ever once come across any explanation of the words about "binding and loosing" except that set forth by the Catholic Church.
It's important to realize that Jesus, as a Jewish rabbi, was training His disciples to be His apprentices. That's what rabbis did. He taught them to teach, He taught them to baptize, He taught them to perform miracles, and He taught them to forgive sins, and gave them the power and the right to do all these things. That the Church has the power of the keys, i.e. the authority to absolve sins, is not a new doctrine or even a Medieval one; it is profoundly Scriptural, rooted in Jesus' own ministry of forgiveness that He passed on to the Apostles, and they to those whom they ordained as successors. The consistent, recorded belief of the Church ever since is exactly that: some of the earliest debates in the ancient Church were about the extent of the power of the keys; yet the common ground among the varying positions was that the Church did have the power of the keys. Considering that forgiveness is a much graver matter than indulgence, it doesn't seem to me like a stretch to suppose that the "whatever" of the passage quoted above includes releasing us from the temporal effects of sin.
3. So What Does This Have to Do With Purgatory?
Unfortunately, like indulgences, Purgatory is among the most widely misunderstood doctrines of the Catholic Church. That this rumor should name both is, therefore, kind of a nightmare for anybody who likes concise explanations. Fortunately, most people who use the internet are models of patient technical analysis, which is why you can trust most of the things you read on it.
Snark aside. Purgatory, in substance, is a "place" where we finish dealing with the temporal effects of sin. (I put "place" in quotes because, being something that has to do with the soul rather than the body, since our bodies don't store moral guilt, Purgatory probably doesn't have a physical location like Rome or Jerusalem or Denny's.) In more Protestant language, if you're into that, it could be described as a place where we finish being sanctified. It has nothing in common with Hell; the defining characteristic of Hell is separation from God, and the whole point of Purgatory is that, in it, we are coming closer and closer to full enjoyment of God.
Obviously, since dealing with the temporal consequences of sin is the only thing that happens in Purgatory (if there were still eternal consequences to deal with, i.e. if you refused Divine forgiveness, you wouldn't be in Purgatory in the first place), indulgences are the sort of thing that could help. The Church does therefore offer indulgences for the dead, to speed them on their way to the final and blessed vision of God.
4. Wait. Why Doesn't the Church Just Indulgence Everything, Then?
Because of what the temporal consequences of sin are. They are not simply arbitrary; they are the natural consequences of doing wrong things, and they are therefore one of the chief means through which Christ teaches and purifies us. For that matter, Christ Himself was "made perfect through suffering," as we are told in the book of Hebrews. It seems a bit silly to expect to reach union with God without suffering if even the God-Man didn't do that.
Let's say that you are a child who, in a fit of anger, has broken your mother's favorite vase; an apology has been made, and you are forgiven, but also grounded. Now, your parents could waive the punishment -- but will they? If they do, it will most likely be because they can see that you've already learnt your lesson, so that the punishment is less needed. But if they can see that you've learned your lesson, it'll be because of something you said or did -- a heartfelt apology, a voluntary replacement of the vase, perhaps an extra effort to eat something they know you don't like at mealtime just to be peaceable. Indulgences aren't handed out at random, by parents or by the Church: if they were, they'd probably do more harm than good, by training us to be used to having no consequences for our actions.
That is why indulgences are attached to specific acts of penance by the Church: specific prayers, acts of service, and so forth; to ensure that the good which the disciplinary consequences would have done your soul is not merely missed, but replaced by something else equally beneficial. That is also why, in order to obtain an indulgence, the Christian must be properly disposed: in other words, in addition to performing the act that an indulgence is attached to, the relevant sin must already have been forgiven, which means you must have repented of it beforehand, which includes a sincere intention to amend yourself.** Repenting means turning away from sin, not just making weepy noises very very loudly. Of course, we're extremely fragile creatures, and God knows that; but if we're simply saying the words of repentance, without meaning them, then it isn't really repentance, for the same reason that saying "There's nothing behind you" to a friend when we can in fact see a zombie behind them isn't really honesty. Indulgences are not licenses to commit sin, and certainly can't be obtained in advance for a nice juicy sin we have planned -- the lack of repentance invalidates them.***
5. So Can You Get an Indulgence From Following Pope Francis on Twitter?
6. Then Why Did They Say You Could?
There was a misunderstanding involved; that, and the media isn't exactly famous for its friendliness to the Catholic Church, nor for its caution in verifying details of doctrine.
Here is what seems to have happened. Pope Francis has gone down the Brazil for World Youth Day. Naturally a lot of people want to go, and it's a way of witnessing to, and building up, one's faith; pilgrimages are a not uncommon devotional practice (even outside of Christianity, e.g. the Hajj in Islam), and this is a pilgrimage. So the Vatican issued an indulgence to those who are attending. But of course not everybody can go.
Unlike World Youth Day! But seriously, this fire was sad in real life.
Some people are too ill to travel; others don't have the money, or the time, or their families are against it, what have you. So, in an effort to be inclusive and generous, the indulgence was also extended to those who are penitent, and are following the events with devotion, but cannot be there in person -- even if that following is through social media such as Twitter. (A parallel example would be the live webcam at the grotto of Our Lady of Lourdes in France, which exists so that those who cannot make a pilgrimage to the site can nevertheless have some remote participation.)
In short, you can -- under the normal conditions, of sincere repentance and acting out of faith and love -- get an indulgence through participating in World Youth Day, which might very well include following Pope Francis on Twitter; but not simply by clicking 'Follow @Pontifex.'
7. But What About --
Sorry, I'm done for the evening. There has been much theology and now Gabriel needs a whiskey.
*Image and caption are xkcd #386 by Randall Munroe.
**I don't have time or space here to discuss the justice or injustice of this punishment. It is, obviously, an important question, but to try to treat it here would be a colossal change of topic. To try to treat it briefly would only cheapen the question.
***This is part of the controversy that Luther was in fact addressing in Wittenberg in 1517. It is a little-known fact that the famous 95 Theses were wholly Catholic -- indeed, they not only accepted but relied logically upon the truth of the Catholic theology of indulgences; more than that, far from being an attack upon the Pope, or the Papacy as such, they were in fact very concerned to safeguard the purity and the honor of the Papal office. Tetzel, the friar of whom Luther rightly complained, was guilty of simony -- the crime of selling holy things, in this case indulgences -- and, apparently, of preaching that they could be bought before committing a sin, so that you didn't have to worry about it afterwards. Tetzel was rightly condemned by the Catholic Church, at the time, with as much vigor as he has ever been condemned by Protestants since.