The Ancient Greek (Roman-era) grammarians, Dionysius Thrax and Aelius Herodianus, were giants that we are in debt of for a lot of our understanding of grammar, and traditional grammar comes from them.
But they did not quite get declensions. They certainly did not get the number of declensions in Greek down to something manageable. We owe a tractable number of declensions to the grammarians of Latin, who got it down to five. The Greek declensions 1, 2, 3 corresponding to the Latin declensions 1, 2, 3, and were arrived at in the Renaissance, when Greek grammar was brought in line with Latin analysis.
From Thematic list, it looks like the notion of five declensions in Latin is original to Priscian, around 500 AD. I’ve browsed through the text of his Institutions of Grammar, and I don’t see anything like an explicit statement of quinque sunt declinationes linguae latinae [there are five declensions in Latin]; he mentions the first declension in passing in his chapter on letters, and as soon as he gets to the noun chapter, he immediately starts mentioning first or fifth declensions without explaining what they are.
That hints that the notion was already familiar, and there are four centuries between Quintilian, the previous major Latin grammarian, and Priscian. (There’s also Aelius Donatus the previous century from Priscian, but he doesn’t mention declensions in his work at all.)
No justification for the ordering is apparent from Priscian, and the ordering certainly has nothing to do with historical reconstruction and Proto-Indo-European; I can guess the motivation for the ordering though. 1st, 2nd, 3rd are very common, 4th and 5th much less so. 1st ends in –a and 2nd in -u(s/m), so alphabetic sorting might be at work; 1st and 2nd are quite regular compared to 3rd, so they could have gone first as easier to learn.