Alvarez said, "Seven orthopedic surgeries and years of chronic pain culminating in two total knee replacements in the past six months have made me realize it's time to move on."
Alvarez, who joined McDonald's in 1994, also resigned from McDonald's board of directors, the company said.
Alvarez was one of McDonald's highest profile executives and was believed by many to be the top candidate to succeed current CEO Jim Skinner when he retires.
"It was probably Ralph's job to give away. He's obviously in a lot of pain," said RBC Capital Markets analyst Larry Miller, who added that he recently saw Alvarez on crutches.