The sixth-seeded Mayer saved seven break points in the first set to force a tiebreaker, then broke for a 3-1 lead in the second.
Mayer made his return from a hip injury that forced him to withdraw from the Australian Open.
Mayer enjoyed his best season last year, breaking into the top 20 for the first time and beating Rafael Nadal in straight sets at the Shanghai Masters.
French wild card Guillaume Rufin and Russian wild card Nikolay Davydenko also advanced.
The former top 10 player won more than half of his return points to break Robert five times. He will face fourth-seeded Richard Gasquet in the next round.