What you are describing is something called imperfect contrition, or attrition.
(contrition in general being the repenting of sins)
There are multiple levels
>Imperfection natural contrition (Called natural attrition)
>Imperfect supernatural contrition (Called supernatural attrition)
>Perfect supernatural contrition
Imperfect contrition or attrition (I will use this from now on) consists in repenting of something for fear of consequences. Natural attrition is repenting of something because of bad natural consequences. This would include things repenting of stealing because you go to jail, or have your reputation damaged. Supernatural attrition on the other hand is repenting of sins specifically because of supernatural consequences, included in this necessarily is some form of faith in Christ, Hell, Heaven, the eternal soul and many other things. So repenting because of your sins only because you don't want to go to hell is supernatural attrition, or imperfect supernatural contrition.
Perfect contrition is the key thing though, this is repenting of sins specifically do to love of God. This isn't very easy to do especially for people who are steeped in sins, and also very importantly it's impossible to know if you've done this.
Included in all of these is of course resolution to STOP sinning, and return to God.
You can see this in the traditional act of contrition.
O my God, I am heartily sorry for having offended Thee, and I detest all my sins because I dread the loss of Heaven and the pains of Hell; but most of all because they offend Thee, my God, Who art all-good and deserving of all my love. I firmly resolve, with the help of Thy grace, to confess my sins, to do penance, and to amend my life. Amen.
Now that contrition is covered, is this saving?
No of course not, you have to do what Christ said to be saved.
>Jesus answered: Amen, amen I say to thee, unless a man be born again of water and the Holy Ghost, he cannot enter into the kingdom of God.
Seems pretty clear.
Perfect contrition, and supernatural attrition kind of aren't even possible for people who aren't baptized.
By being baptized you enter into the supernatural state of Grace
which you can learn about here
https://www.youtube.com/watch?v=nZcP1O9-DTM
and you can learn about grace in general here
https://www.youtube.com/watch?v=N__HvlakxqU
But what CAN they do, because they are still quite powerful.
Natural attrition? Literally nothing, it doesn't matter if you are upset your sins led to bad things happen, shouldn't have done it.
Supernatural attrition? This on the other hand, in the sacrament of confession, is sufficient for forgiveness of ALL post-baptism sins. (baptism forgives all sins prior). So just with the fear of hell, if you go to confession you can have all your sins forgiven, be restored to a state of sanctifying Grace (this is what gets you into heaven, a participation in the divine essence, it's complicated),
and well if you die in a state of Grace you go to heaven. So supernatural attrition is all that's needed for forgiveness of sins.
>21 Jesus said to them again, “Peace be with you. As the Father has sent me, even so I send you.” 22 And when he had said this, he breathed on them, and said to them, “Receive the Holy Spirit. 23 If you forgive the sins of any, they are forgiven; if you retain the sins of any, they are retained.”
You can see in scripture where Christ gives the Apostles the power to forgive and RETAIN sins, which doesn't make sense with anything except confession. Only by confessing your sin to a successor of the apostles can you have your sins forgiven with supernatural attrition (fear of hell).
Perfect Contrition? If you truly repent of your sins for love of God, you have all your sins forgiven, without the need of confession. This is hard to do, and you can't know you do it, so the Church still requires you go to confession, but if someone is baptized and truly repents of their sins for Love of God they enter a state of Grace, and if they die they go to heaven.
But to be clear for perfect contrition to be "saving" you must be baptized, and have a perfect love of God. Even if it does work you won't know, and if you gravely sin again afterwords it counts for nothing.
>12 Therefore, my beloved, as you have always obeyed, so now, not only as in my presence but much more in my absence, work out your own salvation with fear and trembling; 13 for God is at work in you, both to will and to work for his good pleasure.
https://www.youtube.com/watch?v=8GCLa9ducvQ&list=PLi2hQGNTzIBR4krsq7OiNGg8rKJcdbxyr
This is a good lecture that goes more in depth on stuff in scripture to emphasize these points.