Q: Is it true that the Vilna Gaon directed his students to refrain from the study of Kabbalah until the age of 40. If so, why?
A: The Vilna Gaon did not say that one must be 40 years old in order to study Kabbalah. He did say that a rabbi cannot properly decide a law in the Torah without thorough knowledge of Kabbalah.
There are six mitzvot of the heart which every Jew is obligated to fulfill at all times. These include love and awe of G-d. The study of Kabbalah is the way to attain this love and awe. Therefore, every Jew should study the inner dimension of the Torah, Kabbalah, in order to achieve love and awe of G-d. This includes even children, who can study concepts in Kabbalah and Chassidut at their own level. Clearly, every Jew must study Torah at his own level, and not delve into deep concepts without first thoroughly studying the basics.
Nonetheless, it is true that over the years different Rabbis did suggest a minimum age for the study of Kabbalah. This was due to the misuse and misunderstanding of Kabbalah which was prevalent in those eras. The Ba'al Shem Tov introduced Chassidut, the soul of the soul of the Torah, which precludes any abuse of the Kabbalah. Thus, one can learn Kabbalah as expounded upon in Chassidut today without any "danger," making it applicable, and even vital, for every Jew.