Here is a sentence from the Duden dictionary:
Why es vergingen instead of es verging?
Here is a sentence from the Duden dictionary:
Why es vergingen instead of es verging?
It's about the amount of things that are doing the verb "vergehen". In this case, even though at first glance the subject of this sentence is es, this is only a dummy-subject.
The best way to think about it is, is the es necessary? In this sentence, it is not. You could replace
Es vergingen drei Stunden
with
Drei Stunden vergingen (or Drei Stunden sind vergangen)
and you can see clearly that the plural form of the verb should be used. From here you can clearly apply this principle to the imperfect, and therefore add en to the end of the verb. This is different from other constructions using es, which is probably what has confused you (for example es gibt) where the es would be necessary to the sentence.
Es gibt zwei Katzen
Here, the es could not be replaced without changing the sentence completely, so the es is the subject and the verb agrees accordingly.
This is because "drei Stunden" is the subject of the sentence, and it is a plural form, so the verb has to be in plural as well.
Although "es" may look like he subject of the sentence, it's not: It's just a fill-in word. Grammar requires that there is something before the verb. This is called "syntactic expletive" (see Wikipedia).