The simple answer: if you love Jesus with all your heart, and you are truly repentant of past sins and it is your furthermost desire to serve Christ with your life.
But if you’re sincerely asking this question, please read the longer answer:
It is a modern myth in within the religious sphere that calls itself Christendom that if you say the “sinner’s prayer,” or “invite Jesus into your heart,” then you are automatically saved. For example, if you repeat the magic words to the nature of (but not limited to), “heavenly Father, I’m a sinner. I’m sorry for all the bad stuff that I’ve done in my life. Thank you for sending your one and only Son, who died on the cross and rose again for the forgiveness of my sins. Please Lord Jesus, come into my heart and take this life from me and use it to further your glory,” then that would automatically make you a Christian.
True, it does say in the very popular John 3:16 “For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.”
But what does it mean to believe?
If we honestly believe in Jesus, and what he is done, by nature our very lives would change. For in recognizing his Lordship, we will by nature serve him. By recognizing his holiness, we will by nature worship him. It’s not something that will go away over time. When we are in the family of God, we are in for good (although there are sects of Christianity that would dispute this). When we make Jesus Lord of our lives, it is over our WHOLE LIVES, not just the period of time when we are engrossed with emotions or on a “spiritual high.” If you are truly a Christian, you will stand firm long after you first give your life to God. True, you will not be immediately perfect (or ever perfect during our lifetime on this earth), but the yearning to be perfect for/as Christ will be there. You will not turn back on Jesus in the face of the adversity that you in encounter in life.
Yes, salvation isn’t based on works:
Ephesians 2:8-9 - “For it is by grace you have been saved, through faith —and this is not from yourselves, it is the gift of God— not by works, so that no one can boast.”
This fact alone sets Christianity apart from most other religions. We aren’t a Christian because of something we have done, but because what God has done. So we don’t do good in order to get to heaven, we do good because we are already going to heaven! This is why I claim that I’m not “religious” when I strive for perfection, because in my mind, being “religious” corresponds with “my salvation is based on me doing x, y, and z.”
You don’t need to be baptized to go into heaven. You don’t need to go to church to heaven. But, it is commanded of us, and a sincere Christian will want to do their best to follow the commands of God.
How do you know you are a Christian?
Matthew 7:17-20 - Likewise, every good tree bears good fruit, but a bad tree bears bad fruit. A good tree cannot bear bad fruit, and a bad tree cannot bear good fruit. Every tree that does not bear good fruit is cut down and thrown into the fire. Thus, by their fruit you will recognize them.
This passage was talking about recognizing false prophets, but the same can be applied to looking at the lives of people who claim to be Christians. Someone cannot be a Christian, and look like every other tree in the forest. So what are the indicating “good” fruit?
Galatians 5:22-25 - But the fruit of the Spirit is love, joy, peace, forbearance, kindness, goodness, faithfulness, gentleness and self-control. Against such things there is no law. Those who belong to Christ Jesus have crucified the flesh with its passions and desires. Since we live by the Spirit, let us keep in step with the Spirit.
If you want to know if you’re a Christian, ask yourself “am I displaying, and growing in the fruit of the Spirit? Is my deepest desire to do what Jesus wants and to live for him? Are my actions reflecting a pure, forgiven heart? Do I accept what the bible says as truth? Am I truly repentant?” If the answer to these questions is “yes,” then I would have the boldness as to say that there is a good chance that you’re a Christian.
Why don’t I go all the way to say that you’re for sure a Christian? Because only God knows your heart, he knows it better than you do. Every chunk of words can be twisted, and if the meaning that I am trying to get across to you is somehow misunderstood... well let’s just say that your eternal destiny is too weighty for me to simply say “then you are a Christian.”