It is a traditional doctrine of Christian spirituality that a constituent part of repentance, of turning away from sin and back to God, includes some form of penance, without which the Christian is unlikely to remain on the narrow path and be saved (Jer. 18:11, 25:5; Ez. 18:30, 33:11-15; Joel 2:12; Mt. 3:2; Mt. 4:17; Acts 2:38). Christ Himself said that His disciples would fast once He had departed (Lk. 5:35). The general law of penance, therefore, is part of the law of God for man.
The Church for her part has specified certain forms of penance, both to ensure that the Catholic will do something, as required by divine law, while making it easy for Catholics to fulfill the obligation. Thus, the 1983 Code of Canon Law specifies the obligations of Latin Rite Catholics [Eastern Rite Catholics have their own penitential practices as specified by the Code of Canons for the Eastern Churches].
Canon 1250: All Fridays through the year and the time of Lent are penitential days and times throughout the entire Church.
Canon 1251: Abstinence from eating meat or another food according to the prescriptions of the conference of bishops is to be observed on Fridays throughout the year unless they are solemnities; abstinence and fast are to be observed on Ash Wednesday and on the Friday of the Passion and Death of Our Lord Jesus Christ.
Canon 1252: All persons who have completed their fourteenth year are bound by the law of abstinence; all adults are bound by the law of fast up to the beginning of their sixtieth year. Nevertheless, pastors and parents are to see to it that minors who are not bound by the law of fast and abstinence are educated in an authentic sense of penance.
Canon 1253: It is for the conference of bishops to determine more precisely the observance of fast and abstinence and to substitute in whole or in part for fast and abstinence other forms of penance, especially works of charity and exercises of piety.