The 33-year-old, who is missing the World Cup through an injury picked up in the FA Cup final victory, was released by Chelsea at the end of last season.
The midfielder is returning to the Bundesliga side that he reached the Champions League final with in 2002.
Ballack said: "With my transfer to Bayer Leverkusen a circle is complete. I had a beautiful and successful time here, on which I like to look back on a lot.
"That was a factor in my decision."