If a person accepts by faith alone that Jesus died for all our sins and that His death meets all the requirements for our salvation, then as soon as he or she asks the Lord for salvation it will be granted, irrespective of any prior or future actions.
Ephesians 1:13-14 New Revised Standard Version (NRSV)
13 In him you also, when you had heard the word of truth, the gospel of your salvation, and had believed in him, were marked with the seal of the promised Holy Spirit; 14 this[a] is the pledge of our inheritance toward redemption as God’s own people, to the praise of his glory.
Ephesians 1:13-14 tells us at that moment we are marked with the promised Holy Spirit, Who is a deposit that guarantees our inheritance.
If somebody believes in his heart that his good works are required to gain or keep his salvation, then in effect he’s making himself responsible for it and by his action is denying the sufficiency of the Lord’s death.
The only acceptable motive for any subsequent good works we do is gratitude for what we’ve already been freely and irrevocably given, and even then only if they are at the Lord’s prompting and in His strength. Jesus said apart from Him we can do nothing (John 15:5).
John 15:5 New Revised Standard Version (NRSV)
5 I am the vine, you are the branches. Those who abide in me and I in them bear much fruit, because apart from me you can do nothing.