The prior replies were good and correct Catholic teaching.
One poster mentioned that there are 2 inner dispositions associated with confession: 1) Sincere sorrow for offending God that extends from real love of God and 2) the less ideal motive of just wanting to avoid hell but recognizing God’s justice and the need to repent.
#1 is the best confession since one is confessing out of genuine remorsefulness for being selfish and inconsiderate in offending God. By better I mean that it is possble that God will hold us to less severe personal penance (to be paid either on earth or in purgatory).
#2 is least desirable but absolutely preferable to living in sin and risking dieing impenetant. This is a typical case where a “Sunday morning only” Christian who goes to mass out of duty rather than desire but lives the rest of the week pretty much indifferent to God is just not in a deep relationship with God. This is indicative of a luke-warm relationship and a person who needs to really wake up and get mature in their faith. It is very common though for those who are deeply into the secular world and not living a daily prayer life.
God reads the human heart and knows when there is fear based confession vs love and relational based confession. A person who is confessing simply to avoid damnation will normally have a higher personal penance requirement from God. In other words even though the sin is forgiven there is remains a consequence that only God Himself knows about. This temporal debt may require this person to suffer more severely in either life or later in purgatory or a combination at God’s election. We can however, immediately start offsetting the temporal debts of our forgiven sins through genuine prayer rather than letting it all build up for purgatory. Purgatory is no cake walk and we should try very hard to not have to spend much or any time there. The saints have revealed to us that those in purgatory would gladly have suffered the worst pains on earth to escape the intensity of even a moment in purgatory. In fact purgatory is said to have the same spiritual intensity of suffering as the souls in the upper regions of hell but the intense joy of certain salvation makes the suffering a suffrage of love.
This is why it is first of all important to come to confession out of genuine sorrow for offending God (case #1 above). To these God will be more lenient in remitting temporal debts. If one is honest one will know the difference and where he stands here. This is also why all Catholics should practices indulgences and do extra personal penance up and above what the priest gives. I am talking about praying deliberately for an extended time (perhaps in front of the Blessed Sacrament) and doing daily rosaries and working full plenary indulgences. This kind of personal penance will help one genuinely repent and not only help us work to remit our temporal debts but also speed our repentance and transformation so we don’t repeat the same sins over and over again.