Praying a "prayer of repentance" whenever we know that we have willfully sinned is a necessity for every Christian. Of course repentance is required in obeying the Gospel of Jesus Christ. After we are saved though, we still have to deal with our flesh, the world, and attacks by the devil and his demonic minions. The Apostle John wrote this to believers:
If we say that we have no sin, we deceive ourselves, and the truth is not in us. If we confess our sins, He is faithful and just to forgive us our sins and to cleanse us from all unrighteousness. If we say that we have not sinned, we make Him a liar, and His word is not in us (1 John 1:8-10 NKJV).
Then John reminds us that Jesus is our advocate and the propitiation for our sins:
My little children, these things I write to you, so that you may not sin. And if anyone sins, we have an Advocate with the Father, Jesus Christ the righteous. And He Himself is the propitiation for our sins, and not for ours only but also for the whole world (1 John 2:1-2 NKJV).
Living a repentant lifestyle is absolutely necessary to get to heaven as the concept of "once saved always saved" is not true. King David knew this to be true. After he committed adultery with Bathsheba and murdered her husband Uriah, David wrote Psalm 51.
I like praying Psalm 51, just as it is, when I know that I need to make a course correction in my life, praying a prayer of repentance, turning fully back to my Great God and Savior, Jesus Christ.
Psalm 51 - Prayer of Repentance
Have mercy upon me, O God, According to Your loving kindness; According to the multitude of Your tender mercies, Blot out my transgressions.
Wash me thoroughly from my iniquity, And cleanse me from my sin.
For I acknowledge my transgressions, And my sin is always before me.
Against You, You only, have I sinned, And done this evil in Your sight— That You may be found just when You speak, And blameless when You judge.
Behold, I was brought forth in iniquity, And in sin my mother conceived me.
Behold, You desire truth in the inward parts, And in the hidden part You will make me to know wisdom.
Purge me with hyssop, and I shall be clean; Wash me, and I shall be whiter than snow.
Make me hear joy and gladness, That the bones You have broken may rejoice.
Hide Your face from my sins, And blot out all my iniquities.
Create in me a clean heart, O God, And renew a steadfast spirit within me.
Do not cast me away from Your presence, And do not take Your Holy Spirit from me.
Restore to me the joy of Your salvation, And uphold me by Your generous Spirit.
Then I will teach transgressors Your ways, And sinners shall be converted to You.
Deliver me from the guilt of bloodshed, O God, The God of my salvation, And my tongue shall sing aloud of Your righteousness.
O Lord, open my lips, And my mouth shall show forth Your praise.
For You do not desire sacrifice, or else I would give it; You do not delight in burnt offering.
The sacrifices of God are a broken spirit, A broken and a contrite heart— These, O God, You will not despise.
Do good in Your good pleasure to Zion; Build the walls of Jerusalem.
Then You shall be pleased with the sacrifices of righteousness, With burnt offering and whole burnt offering; Then they shall offer bulls on Your altar.