The history of academic dress goes back hundreds of years to the chill universities where cap, gown and hood were needed for covering and warmth.
In 1321, the University of Coimbra mandated that all Doctors, Bachelors, and Licentiates must wear gowns. In the latter half of the 14th century, excess in apparel was forbidden in some colleges and prescribed wearing a long gown. By the time of England’s Henry VIII, Oxford and Cambridge began using a standard form of academic dress, which was controlled to the tiniest detail by the university.
Not until the late 1800s were colors assigned to signify certain areas of study, but they were only standardized in the United States.
This link has a list of the colors and what they mean.