Each of these characters is set up in accordance to the characters' background, setting and other characters.
Sean Maguire teaches psychology at a small college. He grew up in South Boston like Will Hunting. These two characters act as foils for each other in the sense that Sean tries to help Will realize his potential and put his past setting behind him and move on to accomplish great things. Sean serves as the example of how a person can move out of a bad neighborhood and situation and be a success. However, as the story unfolds, it becomes clear that Sean can learn a lot from Will as well.
Gerald Lambeau is an old college classmate and friend of Sean and a brilliant mathematician working as a professor at Harvard. He serves as a great foil for Sean and Will in the sense that he grew up in a privileged setting as they grew up in South Boston. Gerald is arrogant and condescending to Sean, but admires Will because he sees the genius that he is.
Skylar is a Harvard student that starts a romantic relationship with Will. She is very intelligent but she is still amazed by Will's mental abilities. She has inherited a lot of money from her parents' death which enable her to go to Harvard. She tries to get close to Will repeatedly but his nature will not let her in. When she finally breaks his shell he yells at her asking "What do you want to hear? That I don't have any brothers, that I'm an orphan? . . . No, you don't want to hear that." This interaction shows the nature of their relationship and how she was pushing to know the real Will, and he was trying to show her what he thought she wanted to see.
Will Hunting is the main character and protagonist of the movie. Will is a boy genius from South Boston. He has been abused by foster parents his whole life, which has in turn developed his personality to be what it is. Though he is a genius, he takes odd jobs as a janitor and construction worker as he fits into his environment. Will is a product of the rough area he grew up in, South Boston. He fights, gets into trouble with the law, gets arrested, and spends his nights getting drunk with his friends. He does not use his talent as a genius until he is inspired by the character of Sean to do so.
Morgan O'Mally is on of Will's friends from South Boston. He is chronically unemployed and not very productive in his life. He is an example of the friends Will has surrounded himself with; he shows very low levels of intelligence but he is loyal to his friends as shown in the street fight.
Chuckie Sullivan is Will's best friend. He is not stupid, but not school smart either. He has good instincts and is a skilled worker in a construction crew. He also inspires Will to move out of South Boston and be a success. In a conversation he tells Will "Your'e sitting on a winning lottery ticket and you're to scared to cash it in". He lets Will know that he owes it to them to move out because they can't. He is not being loyal by staying by their side.