The 39-year-old Briton, who has been racing competitively since he was six, said he had also battled with depression as an adult, and has found it difficult to open up about his journey.
"I think it was the pressure of the racing and struggling at school. The bullying. I had no one to talk to," Hamilton said in an interview published by The Times on Sunday.
"I’ve struggled with mental health through my life, depression from a very early age when I was, like, 13... when I was in my twenties I had some really difficult phases."
Hamilton made his Formula One debut in 2007 when he was 21, becoming the first black driver in the series.
He won the championship next year and matched Michael Schumacher's record of seven championships in 2020.
Hamilton said he felt more mature today than he was earlier in his career.
"You’re learning about things that have been passed down to you from your parents, noticing those patterns, how you react to things, how you can change those.
"So what might have angered me in the past doesn’t anger me today. I am so much more refined."
Hamilton said he has tried silent retreats to improve his mental health, and while talking to a therapist years ago did not help, he would like to find one in the future.
The Mercedes driver, who is set to join Ferrari next year, is sixth in the championship, with the next race set for Austin next month.
He was knighted in the 2021.