There is no spreadsheet or calculator used to decide how long one is in purgatory. But there's no official take on the average sentence, time wise. According to the church, only God knows the exact amount of time a person must spend in purgatory before attaining a state of purity. It's assumed, however, that the severity of one's punishment will be directly proportional to the severity of the crime.
There are a few passages in the Catechism that talk about "decreasing time in purgatory:"
1498 Through indulgences the faithful can obtain the remission of temporal punishment resulting from sin for themselves and also for the souls in Purgatory.
1475 In the communion of saints, “a perennial link of charity exists between the faithful who have already reached their heavenly home, those who are expiating their sins in purgatory and those who are still pilgrims on earth. Between them there is, too, an abundant exchange of all good things.”87 In this wonderful exchange, the holiness of one profits others, well beyond the harm that the sin of one could cause others. Thus recourse to the communion of saints lets the contrite sinner be more promptly and efficaciously purified of the punishments for sin.
These are based on 2 Macc 12: 40-46:
40 And they found under the coats of the slain, some of the donaries of the idols of Jamnia, which the law forbids to the Jews: so that all plainly saw, that for this cause they were slain. 41 Then they all blessed the just judgment of the Lord, who had discovered the things that were hidden. 42 And so betaking themselves to prayers, they besought him, that the sin which had been committed might be forgotten. But the most valiant Judas exhorted the people to keep themselves from sin, forasmuch as they saw before their eyes what had happened, because of the sins of those that were slain. 43 And making a gathering, he sent twelve thousand drachms of silver to Jerusalem for sacrifice to be offered for the sins of the dead, thinking well and religiously concerning the resurrection. 44 (For if he had not hoped that they that were slain should rise again, it would have seemed superfluous and vain to pray for the dead), 45 and because he considered that they who had fallen asleep with godliness, had great grace laid up for them. 46 It is therefore a holy and wholesome thought to pray for the dead, that they may be loosed from sins.
I heard a really good saint story about this, but I cannot seem to find it. I will edit once I do.