The the Word of Wisdom was originally given as a revelation to Joseph Smith and recorded in Doctrine and Covenants 89:
That inasmuch as any man drinketh wine or strong drink among you, behold it is not good...And again, tobacco is not for the body, neither for the belly...And again, hot drinks are not for the body or belly...And again, verily I say unto you, all wholesome herbs God hath ordained for the constitution, nature, and use of man...Yea, flesh also of beasts and of the fowls of the air, I, the Lord, have ordained for the use of man with thanksgiving; nevertheless they are to be used sparingly...All grain is good for the food of man; as also the fruit of the vine; that which yieldeth fruit, whether in the ground or above the ground...
At various times, some Mormons have interpreted the Word of Wisdom in different ways; here I mention only official changes.
Became a commandment
When it was first revealed (1833), the Word of Wisdom was "a principle of promise" but not a commandment.
...not by commandment or constraint, but by revelation and the word of wisdom...for a principle with promise, adapted to the capacity of the weak and the weakest of all saints, who are or can be called saints.
Doctrine and Covenants 89:2-3
The items prohibited by the Word of Wisdom were in common use, with little known about adverse health effects. The Saints (even the "weakest") were given time to adjust. It later became a commandment.
September 9, 1851, President Brigham Young stated that the members of the Church had had sufficient time to be taught the import of this revelation and that henceforth it was to be considered a divine commandment.
Joseph Fielding Smith, Answers to Gospel Questions, Vol 1. Chapter 48
Adherence to the Word of Wisdom was made a requirement for temple admission in 1902, and remains that way today.
Hot drinks
This is really not a change but a clarification.
"Hot drinks" meant the drinks that were customarily drunk hot at that time: tea and coffee. This was made explicit soon after the original revelation, for example, by the Presiding Patriarch Hyrum Smith:
And again "hot drinks are not for the body, or belly;" there are many who wonder what this can mean; whether it refers to tea, or coffee, or not. I say it does refer to tea, and coffee.
Times and Seasons (June 1, 1842)
Illegal drugs and harmful substances
In modern times, the Church of Jesus Christ of Latter-Day Saints has added the following statement to the official description of the Word of Wisdom:
Members should not use any substance that contains illegal drugs. Nor should members use harmful or habit-forming substances except under the care of a competent physician.