Maybe. But the prayer isn't what saved you, and it can't prove you're saved.
A lot of people call themselves Christians. But ask a few follow-up questions and their commitment to Jesus turns out to be pretty thin, or not there at all. Now you might be thinking, "Who are you to judge? You don't know their heart!" Fair. I don't. But I can see what people do, and what's in our hearts eventually shows up in what we say and do. I'm not trying to be anybody's judge. Someone who repeats what God's Word says isn't a judge, just the mailman. "For the word of God is living and active… discerning the thoughts and intentions of the heart" (Hebrews 4:12 ESV). Let it do the judging.
A lot of people read Romans 10:9, repeat a prayer at camp when they were 12, and figure they're set for life. Confessing Jesus is part of salvation, but it doesn't guarantee it. If I stand in my garage and announce that I'm a car, I'm still not a car. It would take a miracle. Calling yourself a Christian doesn't make you one either. It takes the miracle of salvation, by God's grace through faith (Ephesians 2:8).
Jesus put it bluntly: "Not everyone who says to me, 'Lord, Lord,' will enter the kingdom of heaven, but the one who does the will of my Father who is in heaven" (Matthew 7:21 ESV). Paul described people who "profess to know God, but they deny him by their works" (Titus 1:16 ESV). And James asks, "If someone says he has faith but does not have works… Can that faith save him?" (James 2:14 ESV).
Your actions speak louder than your words. The real test of your salvation isn't your confession. It's your lifestyle.
"So if I still sin, I'm not saved?" No, that's not what I'm saying. Christians sin. I sin. What makes you saved isn't that you never sin. It's that you get back up after you sin and start fighting it again. When you're saved, you fight sin. You don't just keep going in it and shrug.
So don't panic, and don't brush this off either. Do what Scripture says: "Examine yourselves, to see whether you are in the faith. Test yourselves" (2 Corinthians 13:5 ESV). Is your faith just agreeing that God is real? Or has it actually changed the way you live? Ask the Holy Spirit to show you. He'll either convict you or give you confidence. Either way, you win.
Scripture: Romans 10:9; Ephesians 2:8; Matthew 7:17–23; Titus 1:16; James 2:14–19; Hebrews 4:12; Proverbs 24:16; 2 Corinthians 13:5