Matthew 19:16-24 (RSV) And behold, one came up to him, saying, “Teacher, what good deed must I do, to have eternal life?”  And he said to him, “. . . One there is who is good. If you would enter life, keep the commandments.”  He said to him, “Which?” And Jesus said, “You shall not kill, You shall not commit adultery, You shall not steal, You shall not bear false witness,  Honor your father and mother, and, You shall love your neighbor as yourself.”  The young man said to him, “All these I have observed; what do I still lack?”  Jesus said to him, “If you would be perfect [“lack” in Mark and Luke], go, sell what you possess and give to the poor, and you will have treasure in heaven; and come, follow me.”  When the young man heard this he went away sorrowful; for he had great possessions.  And Jesus said to his disciples, “Truly, I say to you, it will be hard for a rich man to enter the kingdom of heaven.  Again I tell you, it is easier for a camel to go through the eye of a needle than for a rich man to enter the kingdom of God.” (cf. Mk 10:17 ff.; Lk 18:18 ff.)
The standard evangelical teaching regarding how one is saved is called sola fide, or “salvation/justification by faith alone.” It doesn't mean that evangelical Protestants frown upon or discourage good works. But they do formally separate works from salvation, putting it in the separate box of sanctification, rather than justification.
To put it another way, if you ask a Protestant how to be saved, he virtually never would say, “do good works x, y, and z.” He would say, rather, “repent, have faith in Jesus Christ; believe in Him; put your faith and trust in Him as your Lord and Savior.”
This is fundamental to Protestantism. Many Protestants erroneously think that Catholics teach “works-salvation” or the heresy known to history as Pelagianism. But we do not believe that we are saved by works. We believe (in agreement with Protestants) that we're saved by God's grace, that (necessary) faith without works is dead (as James teaches), and that faith and works are two sides of the same “coin” of justification/salvation.
What is most striking about this incident in the life of Jesus – given Protestant views – is the almost sole emphasis on works rather than faith, in Jesus' reply to the rich young ruler's question (I’ve combined his words in all three Gospel accounts): “what good deed must I / shall I do to inherit / have eternal life?” It doesn't follow that faith is not involved, too. Elsewhere, Jesus and Paul and other biblical writers say plenty about faith and assent. But it does mean that works are central in the whole equation and can't be separated from faith and put in a secondary category.
The ruler asks, “what good deed must I do?” According to Protestant soteriology (theology of salvation), this isn't even the right question to ask. Their immediate reply would be, “you can't do anything to be saved. All you can do is have faith in Jesus Christ, Who died for your sins.”
Why, then, doesn't Jesus (if faith alone is indeed true) correct him right out of the starting-gate? He didn't do that at all. Instead, Jesus strengthens the man's initial assumptions and explains what works he has to do to be saved: “If you would enter life, keep the commandments.” It's a required condition for obtaining the goal of salvation: “If you want x, do y.”
Then Jesus even individually names six commandments. This means that, since they are all required to achieve eternal life, not observing any of them would disqualify one from salvation. Why didn't Jesus say, “have faith in Me”? Again, in other places, He does emphasize that point. But here He ignores it.
This listing of commandments as a minimal requirement for salvation is consistent with what Jesus taught in His Sermon on the Mount:
Matthew 5:17-19 “Think not that I have come to abolish the law and the prophets; I have come not to abolish them but to fulfil them.  For truly, I say to you, till heaven and earth pass away, not an iota, not a dot, will pass from the law until all is accomplished.  Whoever then relaxes one of the least of these commandments and teaches men so, shall be called least in the kingdom of heaven; but he who does them and teaches them shall be called great in the kingdom of heaven.”
The ruler said he had observed the commandments. So far so good. It's like getting six out of ten answers right on a school exam. You still have to get four more right to receive an A+. According to Jesus, he also has to do one more big thing, that he “lacks” – in order to be saved. He has to sell all he has and give it to the poor.
Note that this isn't required of every man to do. It's not a general rule of Christianity. But for the rich young ruler, it was an absolute necessity. Most commentators think that it was because the ruler had made money his idol, putting it above God in his allegiance. That's why he had to part with it; so that God would occupy the highest place in His life.
In any event, it is a requirement for his salvation. Once again, it is a good work that is made central. It's clear that it was necessary, from Jesus' concluding statement about it being difficult for rich men to enter the kingdom. This is also notable in illustrating that salvation is not a cookie-cutter matter. What is required for one person (in terms of works that exhibit faith) may not be for the next.