Gomez became the latest Bayern injury worry when he needed surgery to remove loose fragments and splinters from his ankle.
"The operation went extremely well," Bayern team doctor Hans-Wilhelm Mueller-Wohlfahrt told the club's website (http://www.fcbayern.telekom.de).
"In all likelihood, Mario will have to sit out training for the next three weeks.
"After that, he'll be able to start on a sports rehabilitation programme."
Gomez said: "I'm delighted it went well and that the pain is gone. I'll need to be a little patient now but after that I'll do everything I can to be available for selection again as quickly as possible."
Gomez, who played for Germany at June's Euro 2012, scored 26 Bundesliga goals last season and 28 the season before that.
The German season starts next Sunday with the Supercup match between Bayern and last season's double winners Borussia Dortmund. The first round of the German Cup follows one week later with the Bundesliga kicking off on August 24.