Rowling has answered thsi 问题 twice, and her 答案 contradict each other a little. In a chat interview she 说 there are a thousand students at Hogwarts but on her official web site's F.A.Q, in a reply to a 问题 related to the Marauders Map, she 说 it has "hundreds of dots". Rowling has also 说 on this topic, that she is bad at thinking in numbers.
So let us 粉丝 try too.
If I counted correctly, apart from the ghosts and Peeves, Hogwarts has 17 adult staff members. We could also count the older students who get the rights to monitor the corridors and other students but they add to the staff only a little and only on one aspect. They don't take away from the teachers' responsibilities as educators, nor can they give detention 或者 watch over them. And Hogwarts is supposed to be the finest school in witchcraft and wizardry. So, I can't see that limited staff running a thousand children in fine and quality education, nursery and discipline. Hundreds students tops and even that would be a challenge.
But how many hundreds, then?
Someone has made a calculation based on the 电影院 in which it seems that there were 30 students in a classroom. (The other person's calculation added up to about 840 students but I think they forgot that not all the 30 were from one House, making their calculation perhaps a bit flawed.)
Now, remark that 电影院 are only 电影院 and may not be the truth for the books, but let me try the first figuration based on the number anyway because 20-30 is usually the size of a class:
There are many classes including students from two different Houses. Having 30 students in a classroom would make some 15 students per 年 per House. 15 x 7 = 105 students per House. 105 x 4 = 420 students in total at Hogwarts.
I'd think that 420 students in total is enough to handle for such a limited staff, especially for the teachers.
But if there was only 15 students per 年 in a House, I think it would mean that students at X 年 from one House would always be taking the same class at the same time. But this could be, unless the 图书 state something against this? I meant the basic studies - of course from the third 年 on some students may have optional studies that others of their 年 from their House don't have.
If we raised the amount of student per 年 in a House to 20 and kept the maximum size of a classroom to 20 students, we could have half of X-years from X-House to take one class while half of them would be on another class. This would result in 140 students per House and 560 in total at Hogwarts.
In my opinion 420 students in total would work the most realistic for some 20 adults to take care of and educate - especially as Hogwarts is supposed to be the finest school. And the number fits Rowlings "hundreds of dots". As far as I know, in public schools too the classes first put together take a lot of same classes at the same time, so X-years from one Hoise always at the same class together would be fine.
So, my conclusion is that there were:
> 15 1st years in each House. 15 2nd years in each House and so on.
> 105 students per House.
>>> 420 students in total at Hogwarts.
> Less than 20 adults to run the lot with a little help in one/some aspect(s) from a few of the older students.
EDIT// I'm leaning towards the calculations in the below comments: perhaps there were only approximately 300 students per year. But app. 400 would still be plausible. But no 更多 than that.