No. 1450, 1451, 1452 and 1453, pages 364 and 365 of the Catechism of the Catholic Church: The Celebration of the Christian Mystery; Chapter Two - The Sacraments of Healing; Libreria Editrice Vaticana: Urbi Et Orbi Communications:
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." (Council of Trent: DS 1676)
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. (Council of Trent: DS 1677)
The contrition called "imperfect" (or "attrition") is also a gift of God, a prompting of the Holy Spirit. It is born of the consideration of sin's ugliness or the fear of eternal damnation and the other penalties threatening the sinner (contrition of fear). Such a stirring of conscience can initiate an interior process which, under the prompting of grace, will be brought to completion by sacramental absolution. By itself, however, imperfect contrition cannot obtain the forgiveness of grave sins, but it disposes one to obtain forgiveness in the sacrament of Penance. (Council of Trent: DS 1678; 1705)
From the Baltimore Catechism No. 3; Benziger Brothers, Inc. and Tan Books and Publishers, Inc. Nos. 764, 765, 766, 767, and 768, page 160 and 161.
Q. How many kinds of contrition are there?
A. There are two kinds of contrition; perfect contrition and imperfect contrition.
Q. What is perfect contrition?
A. Perfect contrition is that which fills us with sorrow and hatred for sin, becasue it offends God, Who is infinitely good in Himself and worthy of all love. 
Q. When will perfect contrition obtain pardon for mortal sin without the Sacrament of Penance?
A. Perfect contrition will obtain pardon for mortal sin without the Sacrament of Penance when we cannot go to confession, but with the perfect contrition we must have the intention of going to confession as soon as possible, if we again have the opportunity.
Q. What is imperfect contrition?
A. Imperfect contrition is that by which we hate what offends God because by it we lose Heaven and deserve hell; or because sin is so hateful in itself.
Q. What other name is given to imperfect contrition and why is it called imperfect?
A. FACE="SouvenirSSK">A. Imperfect contrition is called attrition. It is called imperfect only because it is less perfect than the highest grade of contrition by which we are sorry for sin out of pure love of God's Own goodness and without any consideration of what befalls ourselves. It is sufficient for a worthy confession, but we should endeavor to have perfect contrition.