Early in the history of Mormonism, Joseph Smith, the founding prophet of The Church of Jesus Christ of Latter-day Saints, says of salvation, "If thou wilt do good, yea, and hold out faithful to the end, thou shalt be saved in the kingdom of God, which is the greatest of all the gifts of God" (Doctrine and Covenants 6:13).
By 1834, Smith is using an additional term besides salvation, "the great plan of salvation" (History of the Church 2:23), to describe what had been referred to earlier as the work and glory of God, namely "to bring to pass the immortality and eternal life of man" (Moses 1:39). At about the same time, he taught that members of the LDS Church must "live in strict obedience to the commandments of God, and walk humbly before Him, and he will exalt [them] on high" (History of the Church 1:408). So God has a plan for bringing us back to him, and our return requires life according to that plan, obedience.
As he does in that quotation, Smith uses the word exaltation to speak of salvation, and for him the word had a decidedly Old Testament cast to it. He says it means "a man's being placed beyond the power of all his enemies" (History of the Church 5:392).
That sentiment is understandable given the persecution that Smith and the Latter-day Saints were suffering in the late 1830s and the early 1840s. But of course Smith's description of salvation or exaltation can also be understood in terms of being not only beyond the reach of one's temporal enemies but also beyond the reach of our eternal enemies like death and sin. To be in the presence of God is to be beyond all enemies.
Not surprisingly, the second prophet-president of the Church, Brigham Young (1847-1877), speaks of salvation in terms much like those of Smith. But he additionally says: "Salvation is the full existence of man, of the angels, and the Gods; it is eternal life—the life which was, which is, and which is to come. And we, as human beings, are heirs to all this life, if we apply ourselves strictly to obey the requirements of the law of God, and continue in faithfulness" (Discourses of Brigham Young 12:311).
Salvation is not just being beyond the power of the things, persons, and powers that would harm us. It is fullness of life, the life that God lives, and the attainment of salvation requires strict obedience to the law of God.
That kind of language has been central to much of what Mormons have said about salvation for most of the last 182 years, so one cannot blame those who believe that Mormonism is a religion of works. We have often spoken as if it is, and sometimes continue to do so.
In spite of that, we understand the necessity of grace. For example, the seventh president-prophet, Heber J. Grant (1918-1945), says, "Salvation will come only to those who repent and have their sins washed away by baptism, and who thereafter show by a godly life that their repentance is genuine" (Improvement Era vol. 15, page 785).
Grant's point is that works do not save us. Christ does that. Works demonstrate our repentance. Salvation comes through the atoning sacrifice of Jesus Christ, and obedience expresses our recognition and acceptance of that atonement.
Those who have read the Book of Mormon will recognize that salvation by grace is one of its common themes, as we can see by looking at only one of the books within the Book of Mormon, 2 Nephi:
Redemption cometh in and through the Holy Messiah; for he is full of grace and truth. (2 Nephi 2:6)
There is no flesh that can dwell in the presence of God, save it be through the merits, and mercy, and grace of the Holy Messiah, who layeth down his life according to the flesh, and taketh it again by the power of the Spirit . . . . (2 Nephi 2:8)
My soul delighteth in his grace and in his justice, and power, and mercy in the great and eternal plan of deliverance from death. (2 Nephi 11:5)
It is by grace we are saved, after all [i.e., beyond all] that we can do. (2 Nephi 25:23)
But 2 Nephi is not the only place in the Book of Mormon to find the necessity of grace. The sermons of the Book of Mormon prophet and king, Benjamin (Mosiah 3-4), are clearly imbued with that understanding, as is much of the rest of the book.
Early in his prophetic career Joseph Smith speaks of the necessity of grace: