Ever since Mercury acknowledged as the planet standing for intelligence and reasonability,
dexterity and education.
Like Mercur in Roman (Hermes in Greek) mythology Mercury is taken as a symbol for communication and reliability, while some prefer to forget that Hermes was the patron of the thieves, as well.
Not often mentioned is that Mercury was the chosen symbol of Hermes Trismegistos, the founder of 'hermetic' science, philosophy and literature, together with the Egyptian god of wisdom, Toth.
Therefore, Mercury was the planet of alchemy, as well and is usually attached to the Magician in Tarot.
In astrology, Mercury rules Gemini and Virgo.
Mercury was first associated with the Sumerian god Ninurta, the god of hunt and battle along with agriculture and fertility. Ninurta later became Nabû (or rather a part of Ninurta while another part went to Saturn), with Nabû seen as the son of Marduk and thus assigned the role as the protector of the crown prince. Since Mercury like Venus appears at the sky as both a morning and an evening star Nabû was also depicted as having two sexes, even though in his case the masculinity was dominant. In spring when the planet was observed as particular bright it was sometimes regarded as the Star of Marduk.
Nabû was also considered the minister and scribe of Marduk, the record keeper of the heavenly council and the custodian of the Tablets of Destiny on which were written the functions of moral, social and political order. He was seen as the patron of scribes and his status rose proportional to the growing importance of writing. The cult of Nabû lasted until well into the second century AD and he was later identified primarily with Apollo.
Writing of course was the equivalent of knowledge and wisdom, yet another aspect of Mercury was his reputation as a bringer of rain ('mu-a-az-nin zunni' - Rainbringer Mercury) and thus an enabler of good harvests. It might be that this resulted in his connection with commerce and trade in times when agriculture was the main basis of prosperity. His reputation for swiftness derived from the relative quick movement of the planet Mercury across the skies.
The Egyptians soon equated Nabû with the old Moon god Thoth, an interesting change that probably didn't occur until the fourth century BC and maybe was due to the increasing Hellenistic influence in those times. Thoth actually didn't change much during his 'transfer' from Moon to Mercury and he did not acquire other Greek Hermes attributes like swiftness and trickery.
The Greek Hermes - and consequently his Roman equivalent Mercurius - finally was the one deity whose association to Mercury is still popular today. He was a son of Zeus and served as the messengers of the gods, with a wide range of additional functions. Hermes was the patron god of travellers and pastoralists, of athletes and messengers, of boundaries and roads, weights and measures, trickery and wit and as said above he was the protector of thiefs and frauds. At times he was also seen as a patron for literature and oration and he even knew some of medicine for his task to heal injured athletes. Beside all this he was connected with the arts of commerce, trade and diplomacy. With such an outstanding portfolio Hermes was either the pet subject of Greek poets or a conglomerate of many ancient gods, with Nabû being just one.
As the master of all these abilities Hermes was easily transferred to Hermes Trismegistus - the trice great Hermes - this almost omnipotent superman which later fascinated legions of occultists and was finally shoved down our throats on every page of the Kybalion... ;D