The swimmer, who took home eight gold medals at the 2008 Olympics, said that he let himself go after the competition.
"It was weird going from the highest of the high, the biggest point of your life - winning eight gold medals - and then saying, 'All right, where do I go from here?' I wasn't motivated," Phelps told Details.
"I did nothing, literally nothing, for a long time. I gained 25 pounds."
Phelps went on to speak about the incident in 2009 where he was photographed with a bong.
"It was a learning experience," he explained. "I'm the kind of person who has to go through the learning experiences myself. Somebody could tell me, 'If you eat this much you'll be fat', and I'd be like, 'Yeah, okay, let me try it'.
"Growing up, my mum taught us to make our own decisions, but also that you have to pay for the consequences of those decisions," the 27-year-old continued. "I'm thankful for that.
"I'll be the first to say I've made thousands of mistakes, but I've never made the same mistake twice."
Phelps was named as the new face of head&shoulders in November 2011.