The Catechism addresses this topic in terms of sin in general (i.e., not making a distinction between mortal and venial sin). On one hand, according to the Catechism, temporal punishment due to sin still remains after one receives absolution in the context of the Sacrament of Reconciliation:
“The forgiveness of sin and restoration of communion with God entail the remission of the eternal punishment of sin, but temporal punishment of sin remains.” (CCC #1473, emphasis added)
On the other hand, the Catechism also states…
“The spiritual effects of the sacrament of Penance are:
…remission, at least in part, of temporal punishments resulting from sin” (CCC #1496)
As you can see, there appears to be a bit of a discrepancy here. I once was doing a series of articles on the subject of indulgences and needed to have a proper understanding on this. I had the fortune to ask one of the priests who worked on the English translation of the Catechism about this. He told me that the Sacrament of Reconciliation has the power to purify one of the temporal punishment due to sin if you consider that in the past penitents were often given extremely rigorous types of penance. The Church has gotten away from lengthy penances which impose a notable degree of hardship. Nevertheless, a penance given during Confession should still be appropriate, given the weight of the sin confessed:
“The penance the confessor imposes must take into account the penitent’s personal situation and must seek his spiritual good. It must correspond as far as possible with the gravity and nature of the sins committed. It can consist of prayer, an offering, works of mercy, service of neighbor, voluntary self-denial, sacrifices, and above all the patient acceptance of the cross we must bear.” (CCC #1460, emphasis added)
Naturally, it can be a difficult thing to gauge the appropriateness of a penance against the sin in question. Because of this, even though the Sacrament of Reconciliation can allow for the remission of the temporal punishment due to sin, it usually does not. Because penances in the old days were so extreme, the idea is that there was a good chance that such penances “got the job done” in terms of also dealing with the temporal punishment situation. Keep in mind that patiently bearing the hardships of this life, whether or not it is part of a penance, can allow for purifying the soul of the taint of past sins.
Note how all this is worded in the Baltimore Catechism:
“Does the sacrament of Penance, worthily received, always take away all punishment?
The sacrament of Penance, worthily received, always takes away all eternal punishment; but it does not always take away all temporal punishment.” (Baltimore Catechism #422)
“What are the chief means of satisfying the debt of our temporal punishment, besides the penance imposed after confession?
Besides the penance imposed after confession, the chief means of satisfying the debt of our temporal punishment are: prayer, attending Mass, fasting, almsgiving, the works of mercy, the patient endurance of sufferings, and indulgences.” (Baltimore Catechism #425)