This question already has an answer here:

How does the Sorting Hat prevent one house from being way bigger or smaller than the others?

Related: How big were the houses at Hogwarts?

marked as duplicate by LCIII, ibid, tobiasvl, Jeff, Community Mar 28 '17 at 13:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.