Westeros was settled by the First Men many thousands of years ago. According to legend, when men first arrived on the continent, the land was populated by a diminuitive and mysterious folk known as the Children of the Forest. Without bloodshed, it was decided that the plains would belong to men, and the forests to the Children. Thus it remained for many years.
Around six thousand years ago, the Andals invaded Westeros. After centuries of fighting, the Children of the Forest were extinguished, and the First Men agreed to live in the North. The boundary was set at Moat Cailin. The southern lands of Westeros were divided into seven kingdoms, which were ruled separately.
A little less than a thousand years ago, Nymeria, a famous warrior-queen from the east, fled her homeland with ten thousand ships. When she arrived in Dorne, she allied with Lord Mors Martell, and together they unified the fractious lands under their joint rulership.
184 years ago, in Year 1 by common reckoning, Aegon the Conqueror united by the sword the six of the seven kingdoms of Westeros. The seven kings were the Dornish King, the King of the West, the Storm King, the Iron King (who also controlled the riverlands), the King of the Reach, King Arryn of the Vale, and the King of the North. Aegon arrived with dragons, which had never been seen before. The war was swiftly won, for castles could not guard against dragonfire reigned from above. All but Dorne bent the knee and acknowledged the right of the Targaryens to rule their land. Dorne was left as a separate kingdom. Targaryens have ruled the six kingdoms of Westeros since that day.