The Sorting Hat test is a personality test based off of the school houses in J.K. Rowling's Harry Potter book series. Taking the Sorting Hat test is a way for users to see which house they would hypothetically be placed in.
In the Harry Potter book series, the magical school Hogwarts has four different houses: Gryffindor, Slytherin, Ravenclaw and Hufflepuff. Students wear the enchanted Sorting Hat to receive their house placement, according to the student's personality and goals. Many different websites have recreated a version of the Sorting Hat test so that Harry Potter fans can find out what Hogwarts house they might be in if they were a student there.
The Sorting Hat test is entirely fictional and is often a fan creation meant to be a fun activity. An official test was never provided in the original Harry Potter books, as the Sorting Hat looks into each student's mind to gauge his personality.
The official Pottermore website offers its own Sorting Hat quiz, accepted by many fans as the most accurate, given that J.K. Rowling wrote it. Other sites, like TheAlmightyGuru.com and Sorting-Hat.com, also offer Sorting Hat tests. Most Sorting Hat tests are quite different and may provide different results.