Environment is key in terms of child development and self-perception; children naturally connect their own self-perception to their surroundings as well as their role within that environment. In Harry Potter and the Sorceror's Stone, Rowling easily connects Harry's sense of self-worth to his environment. At the Dursley's, Harry is little more than an inconvenience to his Aunt and Uncle. He feels disconnected from their home, and his room is little more than a broom closet. In many ways, Harry's emotional growth as an individual is completely stunted due to the Dursley's lack of love and care. On his birthday, however, Harry's self-perception undergoes a complete overhaul as he realizes that his past and heritage have been concealed from him.
As the novel's settings change from Privet Drive to Hogwarts School of Witchcraft and Wizardry, Harry reevaluates his self-worth as he takes up residence; he goes from being a shy and misused young man to someone of immense value and importance in the Wizarding Community. His self-esteem, in terms of emotional and psychological development, really begins to improve, as a direct result in this shift of environment. Surrounded by his peers, Harry feels a sense of belonging for the first time. Hogwarts becomes his home in a more complete way than the house on Privet Drive ever could.
Well, let's start with Harry...
Harry has no formal sense of place prior to Hogwarts. His life has been one in the margins. His mother and father were murdered, so he has no familial security and his aunt, uncle, and cousin had to make room for him in a cupboard under the stairs at Dumbledore's will. While growing up in the Dursleys' house, he is forced to serve...he has no time to focus on his self-development.
When Harry goes to Hogwarts, he is given independence in many ways. First, he has financial independence; in the wizarding world, he now has a small fortune, thanks to what his parents left him in their stores. Second, he has autonomy within reason. While at Hogwarts, Harry is not only free to make choices for his own development - he is encouraged to do so. Through his studies, his friendships, and even his battles, Hogwarts becomes a place of freedom for him. He identifies Hogwarts with his own freedom, plainly said. Within those walls, he has identity and self-satisfaction. It takes him seven years to realize that he can have these things without castle walls, too.