The Act of Contrition is part of the Sacrament of Penance and is prayed by the penitent after the priest assigns a penance and before he gives the penitent absolution.
The Catechism of the Catholic Church states the following... "Among the penitent’s acts contrition occupies first place. Contrition is “sorrow of the soul and detestation for the sin committed, together with the resolution not to sin again.” When it arises from a love by which God is loved above all else, contrition is called “perfect” (contrition of charity). Such contrition remits venial sins; it also obtains forgiveness of mortal sins if it includes the firm resolution to have recourse to sacramental confession as soon as possible." (CCC 1451–1452)