The term specifically refers to the union of Zeus and Hera but also has been used to describe the union of Demeter and Iasion and the many unions between mortals and Gods that produced heroes and demi-gods.
The celebration of the Hieros Gamos is often associated with agricultural fertility, but it may have also been a way to legitimize the Gods of invaders by wedding them to the Gods of conquered lands or to legitimize the rule of a human by giving them a divine relative.
In ancient Mesopotamia, the Priestess of Inanna was symbolically married to the King to ensure the blessings of the Goddess on his rule. I have heard tell that similar rituals were celebrated among Celtic Kings as well, but documentation is scant.
In modern NeoPaganism, Sacred Marriage rituals are often incorporated into Beltane or Midsummer celebrations and some traditions perform them more frequently as part of regular esbat observances. Tools representing the male and female principles are often used in lieu of actual intercourse, with the cauldron or chalice representing the female principle and the athame or wand or sword or staff representing the male principle. It is referred to among Wiccans as The Great Rite.
Hierogamy is also an alchemical concept, exploring the union of opposites.