It is laudable for the sinner to confess his sin as quickly as he conveniently can because a grace is conferred through the sacrament of penance which makes a man stronger in resisting sin. However, some said that he is bound to confess as quickly as the opportunity of confessing offered itself so that if he delays he sins. This is against the intelligible structure of an affirmative precept which, although it obliges always, does not however oblige for always but obliges for a fixed place and time. Now the time for fulfilling the precept concerning confession is when an occasion is imminent in which it is necessary for a man to confess, e.g. if the moment of death is imminent, or the necessity of receiving the Eucharist or Holy Orders or the like, for which it is necessary for a man to be prepared by being cleansed through confession. So if one of these events is imminent and someone neglects confession, he sins as long as a due opportunity is present. And because from the Church’s precept all believers are bound to take the communion of the sacrament at least once a year, on the feast of Easter especially, therefore the Church decreed that once a year when the time for taking the Eucharist is near all believers should confess. Therefore, I say that delaying confession until this time, essentially speaking, is permitted, but it can become unlawful accidentally, e.g. if a moment in which confession is required should be near, or if someone delays confession out of contempt. And likewise such a delay may be accidentally meritorious if he delays so that he may confess more prudently or more devoutly because of the holy season.
St. Thomas Aquinas, QQ1.5 (Sandra Edwards, tr.)