Strictly speaking, a heptarchy is a ruling body composed of seven individuals. However, in English history, the term Heptarchy referred to the seven kingdoms that existed in England from the seventh century to the ninth century. Some authors have muddied the issue by using the term to refer to England as far back as the fifth century, when Roman military forces officially withdrew from the British Isles (in 410), to the 11th century, when William the Conqueror and the Normans invaded (in 1066). But none of the kingdoms were really established until the sixth century at the earliest, and they were eventually united under one government in the early ninth century -- only to break apart when the Vikings invaded not long after.
To complicate matters further, there were sometimes more than seven kingdoms, and often fewer than seven. And, of course, the term wasn't used during the years the seven kingdoms flourished; its first usage was in the 16th century. (But then, neither the term medieval nor the word feudalism were used during the Middle Ages, either.)
Still, the term Heptarchy persists as a convenient reference to England and its fluid political situation in the seventh, eighth and ninth centuries.
The seven kingdoms were:
Ultimately, Wessex would gain the upper hand over the other six kingdoms. But such an outcome could not have been foreseen in the early years of the Heptarchy, when Mercia appeared to be the most expansive of the seven.
East Anglia was under Mercian rule on two separate occasions in the eighth and early ninth centuries, and under Norse rule when the Vikings invaded in the late ninth century. Kent was also under Mercian control, off and on, through much of the late eighth and early ninth centuries. Mercia was subject to Northumbrian rule in the mid-seventh century, to Wessex in the early ninth, and to Norse control in the late ninth century. Northumbria was actually comprised of two other kingdoms -- Bernicia and Deira -- that were not joined until the 670s. Northumbria, too, was subject to Norse rule when the Vikings invaded -- and the kingdom of Deira re-established itself for a while, only to fall under Norse control, as well. And while Sussex did exist, it is so obscure that the names of some of their kings remain unknown.
Wessex fell under Mercian rule for a few years in the 640s, but it never truly submitted to any other force. It was King Egbert who helped to make it so indomitable, and for that he has been called "the first king of all England." Later, Alfred the Great resisted the Vikings as no other leader could, and he consolidated the remnants of the other six kingdoms under Wessex rule. In 884, the kingdoms of Mercia and Bernicia were reduced to Lordships, and Alfred's consolidation was complete.
The Heptarchy had become England.