Defending champion Sam Querrey also advanced into the third round with a 7-6 (6), 5-7, 6-3 win over Rainer Schuettler.
Roddick overcame 35 aces and claimed victory on his third match point after playing for 2 hours, 13 minutes. The third-seeded Roddick missed the French Open because of a right shoulder injury.
"I love it on grass and am so happy to be back on it," Roddick said. "I feel good."
There was little to separate the two players, with Roddick holding the slightest of advantages in the opening set as he earned a break point in the sixth game and surrendered just six points on serve before dominating the tiebreaker.
Roddick then fought off two break points to hold for 4-4 in the second set, but Lopez went on to even the match by winning the tiebreaker. Lopez then broke to lead 2-1 in the final set.
But Roddick tied it 3-3 and broke his opponent in the final game to seal the win.
Querrey prevailed, but failed to make the most of his many break points against Schuettler.
"He's played a lot of grass-court matches in his career, so he's a tough guy to get through and I think I did a good job," the 13th-seeded Querrey said. "I was 2 for 16 on break points, but even though my percentage was low on those, I thought I did a good job of keeping my head up and staying positive."
Juan Martin del Potro survived an injury scare as he claimed a 6-4, 6-2 win over Denis Istomin of Uzbekistan. The 12th-seeded player from Argentina struggled several times on the slippery surface. After sliding during the fifth game of the second set, he winced in pain and called for medical attention.
After having his left thigh taped, he continued and closed out the match without losing a game.
"It was to check there was nothing dangerous," Del Potro said. "The trainer said 'You're OK, you can still play,' and he made a bandage so I could finish the match.
"I play really well. Since 2009 was my last match on grass court, so it's a good first round for me."