There is a widespread custom to stay up on Shavuot evening learning Torah. Obvious, you'll say, but the truth is that the custom is mostly kabbalistic in nature. It is most likely that the custom was not practiced outside of kabbalistic circles until the 17th centuries when certain kabbalistic practices somehow went mainstream.
That kabbalistic practices "went mainstream" does not suggest the practices are halakhic in nature – just that they were picked up by a more general population.
One of the reasons given for staying up all night on Shavuot eve is to fix the "mistake" made by those who were waiting in anticipation at the bottom of a mountain, and fell asleep – only to come late to experience Revelation (Shir HaShirim Raba 1:2). As the Kabbalists viewed the holiday of Shavuot as "Zman Matan Torateinu" (a notion which has barely any support in the Torah's account of this agriculturally-focused holiday - though it is mentioned in the Talmud), the dedication to Torah on this date was meant to look like a rededication of our collective commitment to the Torah itself, and our hopes that we could correct the error made by our ancestors at that fateful moment.
However, there are apparently a number of days that contain such a practice of staying up all night. And interestingly enough, they all carry with them another recommended practice – the separation of husbands and wives.
Before getting all upset, it is important to note the words of the Aruch HaShulchan (OC 240), who wrote, "it is only an extremely pious custom (minhag chasidut) to avoid relations on the first night of Pesach, Shavuot, on Shmini Atzeret, and on Rosh Hashana."
The Mishneh Brurah qualifies this ruling similarly as for those "who are extremely God-fearing" (maleh b'yirah). Otherwise one should always bear in mind that the only mandated separation periods are Yom Kippur evening, Tisha B'Av evening, during a niddah period, and when either he or she is in the mourning period of shiva.
Other evenings that are mentioned in halakhic works (to stay up learning, that is) are Hoshana Rabba (Rama OC 664), the 7th night of Pesach (see Birkei Yosef 240), and the Kohen Gadol on the evening of Yom Kippur. It is interesting to note that one approach associated with the 7th night of Pesach ascribes the practice to the phrase "V'lo karav zeh el zeh kol halaylah" (Shmot 14:20), which means "This did not come close to this all night" – seemingly referring to the camps of the Israelites and Egyptians that stood on opposite sides of a pillar of fire during the evening in which the sea was splitting.
The rabbis would not let a verse like that go to waste, and suggested that "This not coming close to this" refers to husbands and wives. This would make it a custom to have husbands and wives separate on the 7th night of Pesach. And of course, once separate, one may as well learn Torah.
The separation in preparation for Shavuot is a little more palatable. After all, God mandated that husbands and wives have a three-day separation in advance of Revelation. (Shmot 19:15) While I do not believe such an act is necessary beyond that one-time in the wilderness, if people want to commemorate such a separation in advance of Shavuot, I guess they are entitled to do as they please.
The bottom line is that it seems the staying up learning idea is often directly correlated to a husband and wife separation.
The Magen Avraham describes what is meant to be the scholars pursuit during the week – namely to study Torah at night.
Not all of us have the luxury to make "Toirahseinu Umanoseinu" – the Torah our regular pursuit. But we do have a charge to study it and learn from it at whatever turn.
I don't know for sure which idea came first – separation from spouses or the idea to learn all night. But a message that could be taken is "when you are looking for some way to spend your time, because other options are taken away from you, pursue the Torah and the study of Torah." That is certainly a lesson to take to the bank all year long - not just Shavuot night.
Whether one does stay up learning or one goes to sleep at the regular hour, may we be blessed to dedicate much of our Shavuot experiences to Torah learning.