Traditionally, the academic robes like those seen at graduation ceremonies are the remnants of the robes that monks and clergymen would wear in early monasteries. Since these were the center of research and progress before the establishment of dedicated learning institutions such as colleges and universities, it was only natural for academics to adopt a modified version of the clergy robe. For many years these robes were worn daily by academics studying at a university.
While some ancient universities even today wear academic robes daily, or some for a period of time at the opening and closing of a term, nowadays full academic regalia is only worn at graduation ceremonies at most institutions of learning. In fact, the interest in academic robes even at graduation ceremonies has been in resurgence recently since it was viewed as stuffy and too “establishment” to wear formal academic robes by many students and activist groups in the 60s.
There are many different kinds of robes for different academic rankings including undergraduates, bachelors, masters, and doctorates. In ancient universities it was common for even undergraduate apparel to differ depending on status in the university and/or society at large. They ranged from elaborate and colorful with gold lining for noblemen down to plain black robes for scholars or commoners.
It is also interesting to note that the tradition of moving the tassel from the right to left is of more modern origin–not to mention difficult to do outside in windy weather! Elaborate or formal ceremonies often involved an official bestowing a tassel or some such to each graduate, however with the large graduating classes of many universities, it is much simpler to have everyone move their tassel individually. Plus, it allows for more variety and decoration from things like special school colors to special awards bestowed by the university.