One ordinance received in the temple is called the endowment. The word endowment means "gift," and the temple endowment truly is a gift from God. The ordinance consists of a series of instructions and includes covenants to live righteously and follow the requirements of the gospel. The endowment focuses on the Savior, His role in Heavenly Father's plan, and the personal commitment of each member to follow Him.

The endowment was instituted by founder Joseph Smith, Jr. in the 1840s with further contributions by Brigham Young and his successors. The ceremony is performed in Latter Day Saints' temples, special places dedicated specifically for the endowment and certain other rituals sacred to Mormons, and is closed to all but worthy Mormons. There was a brief period during the construction of the Salt Lake Temple where a small building referred to as the Endowment House was used to perform the ritual. The endowment is currently practiced by the LDS Church, several denominations of Mormon fundamentalism, and a few other Mormon denominations. The LDS Church has simplified its ceremony from the way it existed in the 19th century, and has removed some of the more controversial elements.

According to the LDS church, the endowment ceremony was revealed to Joseph Smith by God. According to church detractors, the endowment ceremony was based on the Masonic initiation ceremony.

As to the specific changes, the Wikipedia Endowment article has a section at the bottom called "Later modifications by the LDS Church". It's too long a section to quote in the answer.

One note regarding possible basing on Masonic ceremony. The Masonic ceremony has its roots in King Solomon's Temple. So it is conceivable that the LDS Endowment is a restoration of the same ceremony that the Masonic ceremony is based on, but not actually based on the Masonic ceremony. This would make the two ceremonies siblings or cousins.
–
Jim McKeethFeb 23 '12 at 5:10

After the first temple ordinances in Nauvoo, some early LDS leaders understood them to be a restoration of true masonry (letter from Heber C. Kimball to Parley P. Pratt, and from the diary of Benjamin F. Johnson).