There is much confusion that exists about the question of whether we are saved by grace or saved by works. The LDS people are often misrepresented in mainstream Christianity as a people who believe we can work our way into heaven. This is an inaccurate representation, which unfortunately is made worse by the members of the church who themselves find it hard to define this particular doctrine.
Conversely, there is a widely held belief throughout mainstream Christianity that we are saved by grace alone, with no other responsibilities tied to it. Often termed "hypergrace" by Christian preachers, these churches are likewise trying to educate their parishioners on the inaccuracy of this explanation of salvation.
So where does the real definition fall? The more I read through the scriptures, trying to reconcile the seemingly contradictory statements (Ephesians 2: 8-9 vs. Revelation 20:12 or James 2:17, for example) the more I realize that the two beliefs are actually the same. It is only in trying to distance the one "religion" from the other that the seeming variance has occurred. But truly, both LDS and mainstream Christians assert that it is by grace alone that salvation comes, but that we must reach out to accept the gift through faith (a "work" in itself, on our part) and then continually access the power of the atonement through repentance (also a "work.")
Here is a quote that, I think, summarizes the concept beautifully:
"With this background then, one can understand why the scriptures clearly stress that faith includes works; that is, obedience, commitment, and repentance - these are the works of faith that open up the channels so that the power of the atoning sacrifice of Christ can flow into us, redeem us from sin, and bring us back into the presence of God. Disobedience and wickedness dam those channels. The righteous works in the themselves do not save us. The atoning power of God saves us. But our righteous works, activated by our faith in the Saviour, are the condition for the operation of that power. Thus, each of us has something to say about whether he will be able to seek the gift and power of the Atonement in his behalf."
"We are saved by grace - saved by Christ's love from the physical and spiritual death; saved by Christ's love from Adam's fall and our own; saved from sin and transgression by the grace or gifts of God. The atoning power of God unto salvation is a freely available gift from him - but our works of righteousness are essential to bring the gift into power in our lives. Sin brings alienation from God. The more we sin, the greater the alienation and the more difficult it becomes to effectively tap the power of God, which alone is sufficient to save us from our sins." (Gerald N. Lund)
Deep doctrine, right? I think this all definitely falls under the "mysteries of God" and I'm not sure we can ever really understand how it all works. But I think the above definition clarifies what we need to know about it, in regards to ensuring our own eternal destiny.
I think it covers both the "works" misconception that you have to reach a certain level of righteousness to be saved, and the "grace" misconception that by simply (and only) saying you accept the grace of God you have no responsibility to demonstrate that faith. Simply said, out of true faith comes works of righteousness. We will never be perfect, we absolutely cannot by our own merits. But if we are truly converted, then it will be impossible not to have an outpouring of good works. Essentially, good works are the evidence of the true faith necessary to be saved by the grace of God.