The practice is an ancient one, believed to be ten thousand years old. It was begun by the First Men, who only followed strength and bravery. Their lords and kings were great warriors and mighty men. It was considered a blessing for a warlord to bestow his seed upon the bride on her wedding night, and if a child came of such a coupling, so much the better, for the husband would have the honor of raising a hero's offspring. This tradition remained after the coming of the Andals.
The right states that when commoners or peasants marry, their lord or king might bed the bride on the first night. This tradition sometimes even allowed kings to bed the noble wives of vassal lords and bannermen on their wedding night, although this rarely took place, as a shrewd ruler would be aware of the resentment this would cause and how easily it could make enemies. The tradition of the lord's right to the first night led some commoners to marry in secret or not inform their lords of the marriage, as they had no wish to share their brides, nor did the bride often wish to be shared.
When the Targaryens first came to Dragonstone, they later learned of the custom and began practicing the tradition themselves. While the first night was greatly resented and loathed in the rest of the Seven Kingdoms, it wasn't on Dragonstone, for the common folk viewed their beautiful, foreign rulers almost as gods.  When a Lord of Dragonstone took his rights according to the first night custom, the brides were seen as "blessed", and the children born of such unions were often given lavish gifts by their father. These bastards who inherited Valyrian features were said to be born of "dragonseed", and in time, became known as "seeds".
Under the Iron Throne
Late in the conquerors reign, Lord Gargon Qoherys of Harrenhal was infamously known as "Gargon the Guest" for inviting himself to weddings throughout his holdings to invoke his lordly right of first night with the brides as frequently as possible. Gargon became despised, and was eventually murdered at the beginning of the rule of Aenys I Targaryen by the rebel Harren the Red. Harren after capturing Gargon cut off his genitals and fed them to dogs, while Gargon bled to death. Harren was only able to get to Gargon due to the actions of a castle servant whose daughter Gargon had “honored” at her wedding.
During the reign of King Jaehaerys I Targaryen, his beloved wife Queen Alysanne overheard numerous stories involving the first night in her women's courts. The most disturbing came from a girl in a brothel at Mole's Town in 58 AC, a daughter of a blacksmith who was wed to her father's apprentice when she was fourteen. Just as they finished their marriage vows, their local lord came upon the wedding with his men-at-arms to claim his right. After the first night, she was returned to her husband, who lost all affection for her. Since he could not raise his hand against the lord for peril on his life, he raised it against his wife instead, and when he discovered she was pregnant with the lord's child, he beat her until she wasn't and called her nothing but a whore. The woman decided if she was going to be called a whore she might as well live like one and fled to the Mole's Town brothel, where she remained.
Alysanne brought this story and the countless others she had been told of before the small council. Alysanne pointed out what happened to Lord Gargon the Guest. Grand Maester Benifer also stated that there were many more instances of a lord being murdered by those seeking revenge due to the right of the first night, and thus the right was also a threat to the King's Peace. Alysanne declared the law was not the same as it was when it was founded thousands of years ago, as none of the men practicing it now are mighty heroes.
The council agreed, and the lord's right to the first night was abolished in what became known as the second of Queen Alysanne's laws: henceforth a bride's maidenhead would only belong to her husband, whether joined before a septon or a heart tree, and any man, be they lord or peasant, who would forcibly take her on her wedding night or any other night would be guilty of rape. This law made Alysanne deeply beloved of the smallfolk, though some lords resented it.
Although it is now against the law, some houses in the Seven Kingdoms, such as the Boltons and Umbers (although they deny it), as well as the inhabitants of Skagos and some northern mountain clans, are rumored to still illicitly uphold the first night. At Lord Tywin Lannister's wedding to Lady Joanna Lannister, King Aerys II Targaryen drunkenly japed about how it was a pity the first night was banned, and he took certain liberties in the bedding ritual when the men at the feast had to disrobe the bride.
The lords claiming the first night now are no heroes. You have not heard the women speak of them. I have. Old men, fat men, cruel men, poxy boys, rapers, droolers, men covered with scabs, with scars, with boils, lords who have not washed in half a year, men with greasy hair and lice. These are your mighty men. I listened to the girls, and none of them felt blessed.
The moment I set eyes on her I wanted her. Such was my due. The maesters will tell you that King Jaehaerys abolished the lords right to the first night to appease his shrewish queen, but where the old gods rule, old customs linger. The Umbers keep the first night too, deny it as they may. Certain of the mountain clans as well, and on Skagos ... well, only heart trees ever see half of what they do on Skagos... The miller's marriage had been performed without my leave or knowledge. The man had cheated me. So I had him hanged, and claimed my rights beneath the tree where he was swaying.
- A Dance with Dragons, Chapter 32, Reek III.
- Fire & Blood, Jaehaerys and Alysanne - Their Triumphs and Tragedies.
- The Princess and the Queen.
- The World of Ice & Fire, The Targaryen Kings: Aegon II.
- Fire & Blood, Three Heads Had the Dragon- Governance Under King Aegon I.
- The Sons of the Dragon.
- A Dance with Dragons, Chapter 43, Daenerys VII.
- Droit du seigneur -- Wikipedia article on a similar custom, though it is not proven to have existed.