system
Given the following post, respond as if you're commenting on Reddit:
human
[Harry Potter] Could a student at Hogwarts ask to switch houses if they were really unhappy?

The sorting hat can't tell the future, and people can change. 

What if say a student arrives back year 2 or 3 and has changed as a person? Or maybe they have more friends in another house and don't get along with their own housemates. 

Can they ask to just change? Would they be allowed? Have another go with the sorting hat? 

Or maybe it would just depend on the current Headmaster, I can't see Dumbledore having a problem, someone like Phineas Nigellus not so much.
gpt
It's likely at the headmaster's discretion, probably with the agreement of both heads of houses.  The Sorting Hat takes a bunch of confused 11 year olds, some of which are completely new to the concept of magic in general and definitely Hogwarts in particular, and try and figure out their core personality.  It's not like there's one house that's the perfect fit for each student, the Sorting Hat says that Harry would be good in Slytherin too.  If a student is wavering or can be good in either house, I'd hope there's some sort of petition to switch houses.  Or even if it's not a personality thing, what if you just don't get along with somebody in your house, are you just supposed to live in the same room with your bully or your ex for the next 5 years?  It's not like there's much teacher control about what happens in the common rooms.