Rom. 2:13 For it is not merely knowing the law that brings God's approval. Those who obey the law will be declared right in God's sight.
Knowing and doing are two entirely different things. There are so many who were taken to Sunday School and church early in their lives who have chosen to not live what they learned. They can recall and sing the songs they learned. They can recite some of the more well-known Scriptures that they memorized. They may even understand what it all means, yet they have chosen to not live it.
It is good that one learns the simple things of the Gospel. It is good that people have the truth ingrained within them. It is good that we know that Jesus loves us and wants to have a relationship with us, but none of it will do us any eternal good if we don't take it to heart and let Jesus be our Savior and then Lord.
What we know does not make us right with God. It may influence our lives and help us to live "good" lives, but it will not get us into heaven. God is not impressed by what we know, no matter how well we know it. He does not accept those who do not accept Him.
Only those who accept Jesus as their Savior and strive to live righteous lives will make it to heaven when they die. God declares righteous those who live righteously before Him.