Let's start by looking at what the Catechism of the Catholic Church says. It has a couple of great references:
1030 All who die in God’s grace and friendship, but still imperfectly purified, are indeed assured of their eternal salvation; but after death they undergo purification, so as to achieve the holiness necessary to enter the joy of heaven.
1031 The Church gives the name Purgatory to this final purification of the elect, which is entirely different from the punishment of the damned. The Church formulated her doctrine of faith on Purgatory especially at the Councils of Florence [which took place in 1439] and Trent.
Interestingly, there's also a good description of this understanding of sin in the section on indulgences:
1472 To understand this doctrine and practice of the Church, it is necessary to understand that sin has a double consequence. Grave sin deprives us of communion with God and therefore makes us incapable of eternal life, the privation of which is called the "eternal punishment" of sin. On the other hand every sin, even venial, entails an unhealthy attachment to creatures, which must be purified either here on earth, or after death in the state called Purgatory. This purification frees one from what is called the "temporal punishment" of sin. These two punishments must not be conceived of as a kind of vengeance inflicted by God from without, but as following from the very nature of sin. A conversion which proceeds from a fervent charity can attain the complete purification of the sinner in such a way that no punishment would remain.
What we see then is this: there are certain sins ("mortal" or "grave") which make us incapable of eternally accepting the love of God; but even the lesser sins we commit damage the relationship between us and God in such a way that we are, not incapable of eternally accepting God's love, but at least unready to do so. People who die in such a state will be subject to this "final purification of the elect".
What about St. Dismas (the Good Thief)? I don't know that the Catholic Church recognizes a specific reason that he was able to be with Jesus in Paradise (surely Heaven) "this day". However, look at the final sentence of paragraph 1472 above: "A conversion which proceeds from a fervent charity can attain the complete purification of the sinner in such a way that no punishment would remain." And then look at what this man has just said (in Luke, chapter 23):
we have been condemned justly, for the sentence we received corresponds to our crimes ... Jesus, remember me when you come into your kingdom.
One might argue that this represents the sort of conversion described above, which would result in the total purification of the thief.
How about the recently baptized? The Catechism discusses the phrase from the Nicene Creed, "One baptism for the forgiveness of sins". In paragraph 978, it quotes the older Roman Catechism, which dates from the Council of Trent:
When we made our first profession of faith while receiving the holy Baptism that cleansed us, the forgiveness we received then was so full and complete that there remained in us absolutely nothing left to efface, neither original sin nor offenses committed by our own will, nor was there left any penalty to suffer in order to expiate them.... Yet the grace of Baptism delivers no one from all the weakness of nature. On the contrary, we must still combat the movements of concupiscence that never cease leading us into evil.
Thus, most of us who are baptized have still to "fight the good fight"; we have still the tendency to sin which can lead us astray. But those who are recently baptized and who die before they have the opportunity to commit sin (which can include infants, or those baptized just before death) have no need for purification beyond that which was provided by baptism itself; thus, they will also "be with [Jesus] today in Paradise". The same, it transpires, is true for those who intend and earnestly desire to be baptized, but who die before they have an opportunity to sin.