Matthew 19:25-26 (NKJV)
When His disciples heard it, they were greatly astonished, saying, "Who then can be saved?" But Jesus looked at them and said to them, "With men this is impossible, but with God all things are possible."
Jesus was talking to the rich young ruler who had asked Him this question and Jesus, knowing what was in his heart, had answered him by telling him to keep the commandments and to sell all he had and come follow Him. All of this seemed impossible to his disciples which is exactly the point Jesus wanted to drive home. Man cannot save himself by what he does. You cannot earn your way to heaven. However, God can save you and offers it to you as a free gift if you will accept it.
Ephesians 2:8-9 (NKJV)
For by grace you have been saved through faith, and that not of yourselves; it is the gift of God, not of works, lest anyone should boast.