Quite far, actually.
Elizabeth II and (and all of her predecessors) can count her descent directly back to William the Conqueror. William himself was indirectly related to prior English Kings - he was the first cousin once removed of King Edward the Confessor, a direct descendant of Alfred the Great. His claim was no more dubious than the man he took the crown from - Harold Godwinson had been Edward's brother in law. Both men claim to have been promised the throne by Edward.
William took the crown in the Norman Conquest of England, a subject that you should have no difficulty finding information on. A number of dynasties have taken the throne through war or inheritance since but all of them can be traced in a direct line back to William.
Here is a detailed family tree showing her relations.
The Queen can trace her ancestry to back to the Anglo-Saxon House of Wessex and according to the Anglo-Saxon Chronicle they were descended from Woden.