You phrased that question really weird. It wasn't that he had a problem with his hair at all; he had a problem with beautiful women.
You see, the Lord told Sampson's parents to never cut their son's hair because that would be where his strength came from-- so as long as his hair was long, he would be super strong. He, however, lusted after Deliah, even though she was a Philistine (who were the enemies of the Israelites). Well, some of the Philistine leaders told Deliah that they would pay her if she could figure out the secret to Sampson's great strength.
She asked him twice, and both times he told her a lie that had to do with that if she were to tie him up with a certain number of ropes then he would be helpless. She tried these, however, and discovered that they clearly did not weaken him in the least.
Deliah kept on nagging Sampson so much that he finally told her that if she cut off his hair he would be weak. She did this and the Philistine leaders came and took him away to their prison, where they gouged out his eyes.
After a while his hair began to grow back and he began to grow stronger. One day, the Philistines summoned him to a big party type thing they were having in this big building that was supported by pillars.
He asked one of the servant boys to put his hands on the pillars so that he could lean against them, but instead he pushed them down so that they crushed all of the hundreds of Philistines inside and killed himself in the process.