Tikun Leil Shavuos
The Zohar (vol.1, 8:) mentions the minhag to study Torah all night long on Shavuos: "Reb Shimon and his holy students were singing the Torah and creating chiddushim [Shavuos night]... and they were very joyous. Reb Shimon told them, 'My children, you are fortunate because tomorrow the kallah [the Torah] will go to the chuppah with you – and only with you – because you are making the tikun tonight, and you are rejoicing with the Torah... Hakadosh Baruch Hu will bless you with seventy brachos and put a crown on your head... Whoever joins us on this night will be protected... the entire year. He will live the year in peace.'"
The Yerushalmi says, "Don't read it לכם תהיה עצרת, read it לכם תחיה עצרת, which means, 'Shavuos you will live.' We can explain that one attains life from Shavuos because life is given to all those who study Torah on Shavuos night.
It states (Shir HaShirim 5:2), ער ולבי ישנה אני, “I am asleep, but my heart is awake.” The Imrei Emes zt'l said that ישנה is gematriya ה"שס, representing the 365 nights a year that one sleeps. ער ולבי refers to the night of Shavuos when people remain awake. It is called לבי, for it is the heart of the year.
The Magen Avraham (494) writes, "The Zohar (vol.3, 98.) tells us that the early chassidim would remain awake the entire night of Shavuos and study Torah. This is the current custom today for most Torah scholars. We can explain according to pshat: Bnei Yisrael slept all night [before matan Torah], and Hakodosh Baruch Hu had to wake them [to receive the Torah], as the Midrash tells us. Therefore, we must rectify this."
The Shlah HaKadosh (Masechta Shavuos, Ner Mitzvah, 8) quotes the following episode, as it was told by Reb Shlomo Alkabetz (who composed the Lecha Dodi) zt'l: "[Shavuos night], we were studying Mishnayos. We completed two masechtos, and then Hashem granted us to hear a bas kol from Heaven that said, 'My beloved, righteous friends, peace to you. You are so fortunate. Ashreichem! You are fortunate, and your parents who gave birth to you are fortunate. You are fortunate in this world and the next world, for you devoted yourself to crown Me on this night. My crown has fallen years ago, and no one has consoled me since then. I was thrown to the earth; I lie in rubbish. You returned the crown to its place! Be strong, My friends, whom I love. Be happy! Rejoice! You are exalted people... Your kol Torah rises before Hakadosh Baruch Hu and breaks through several heavens. The malachim... are silent. Hakadosh Baruch Hu and all the hosts of heaven listen to your voices... You earned this greatness. You are fortunate, and so are your parents who gave birth to you... because you didn't sleep this night, and I was elevated this night. Therefore, be strong, be happy, My children, My beloved. Rejoice... and don't stop your studies... Your Torah study is sweet before Hakadosh Baruch Hu. Stand on your feet and elevate Me and say in a loud voice like on Yom Kippur, ועד לעולם מלכותו כבוד שם ברוך'...and they did so."
The Tikun Leil Shavuos has the first and the last three pesukim of each parashah and each Navi and Kesuvim. The Ben Ish Chai writes, "The early generations established that we should read the first three and last three pesukim of each portion of ך"תנ, and it is considered like he read the entire ך"תנ. This reveals Hashem's chesed that he does with Yisrael, that a drop of learning Torah is considered like a lot."
The Seder HaYom (Shavuos) writes, "On the night of Shavuos, one should remain awake and study Torah all night long, (or, at least, you should study Torah most of the night) ... Don't take this matter lightly because a person might be low and unimportant in one area and have amazing strengths in other ways. He sustains the entire world – and that is something that even the malachim can't do. He gives strength to Hashem, the Creator of the world... And, chas veshalom, [if one sins], he weakens the strength of Heaven and draws His right hand back. As it states, תשי ילדך צור, 'You weakened the strength of the One Who created you.' "Therefore, every person, והדיוט שבקטנים קטן שבהדיוטות, even the lowest and most simple person, should consider himself great and say, 'Perhaps I can fulfill Hashem's will.' ... Don't say, 'Who am I, and what is my worth that the worlds should be rectified through me?' ... Such thoughts cause disaster – onto oneself and others – because [if he thinks so], he won't be cautious with his deeds..."