Question: when did the word of wisdom become mandatory?
Answer: February 1834

Originally, abiding by the recommendations and prohibitions of the Word of Wisdom was not considered mandatory: it explicitly declares itself to be "not by commandment or constraint". In February 1834, however, Joseph Smith proposed a resolution before the high council of the church that stated, "No official member in this Church is worthy to hold an office after having the word of wisdom properly taught him; and he, the official member, neglecting to comply with and obey it."  This resolution was accepted unanimously by the council.