How were there 80,000 ninjas in the Shinobi World War in Naruto?
Let's approximate the size of the Hidden Leaf based on the size of the Nine-tails in his attack:



As you can see, the village is quite large. I can estimate a population of over 100,000 easily. Since many of them are shinobi, I don't think it's exaggerated to think that there are at least 12,000 shinobi there (probably more).

So that's where all of them came from. Don't forget that we are focusing on only one (two) set of academy students as they progress, in reality there are new (and old) classes every year that graduate, get their own Jonin sensei, and take on missions etc. Those unimportant characters are often seen as what I like to call "shuriken throwers" (they only know how to throw shuriken, nothing else). You usually see them die when a strong opponent arrives.