Hogwarts was founded over a thousand years ago by four powerful wizards: Godric Gryffindor, Salazar Slytherin, Rowena Ravenclaw and Helga Hufflepuff. They chose to split the students into four ‘houses’, each bearing their surnames and featuring young wizards and witches who displayed abilities and personalities they wanted to nurture.
To do this, Godric Gryffindor used his magical hat – henceforward known as the Sorting Hat – to decide which children should go into which house, and so it has been ever since with a yearly Sorting Ceremony that places each new pupil into their own new home.
The four houses have different entry requirements, and nobody summed them up better than the old Sorting Hat itself in its welcoming song...
‘You might belong in Gryffindor, Where dwell the brave at heart, Their daring, nerve and chivalry Set Gryffindors apart.’
‘You might belong in Hufflepuff Where they are just and loyal Those patient Hufflepuffs are true And unafraid of toil.’
‘Or yet in wise old Ravenclaw If you’ve a ready mind Where those of wit and learning Will always find their kind.’
‘Or perhaps in Slytherin You’ll make your real friends Those cunning folk use any means To achieve their ends.’