Seventh seed De Potro won 6-7 (1-7) 7-6 (7-4) 6-2 6-4 to set up a quarter-final meeting with Serbia's Novak Djokovic.
"I've loved every minute of it," said an emotional Roddick.
"I love you guys with all my heart. Hopefully I'll come back to this place someday and see you all again."
The match was held over from Tuesday because of rain and resumed in a first-set tie-break, which 20th seed Roddick won comfortably.
Andy Roddick factfile
Born in Nebraska
Wins first ATP Tour titles in Washington, Houston and Atlanta
Wins US Open and becomes world number one
Hits a then world record 155mph serve
Loses Wimbledon final to Roger Federer
Wins Queen's but loses to Federer in Wimbledon final
Loses to Federer in US Open final
Loses to Federer in Wimbledon final again
However, from the moment 2009 champion Del Potro won the second-set tie-break the Argentine was in complete control.
Roddick saved one match point to huge cheers from a partisan crowd but it was not to be as Del Potro won in three hours and 15 minutes.
Roddick struggled to mask his emotions in the final couple of games and was in floods of tears before he addressed the crowd.
Speaking at the post-match news conference, Roddick said: "It was tough. Once he got up in that match it was a different set of circumstances than my previous matches.
"You start thinking about how real it is. You're thinking about matches you're playing when you're 12, I was thinking about my mom driving me to practice all over the place.
"Then all of a sudden you have to play a point against one of the best players in the world. It certainly was a mixed bag there at the end.
"Playing the last five games was pretty hard. Once I got down a break I could barely look at my box. I don't know what the emotions are. I'm a little overwhelmed right now."
In explaining last week's decision to retire, Roddick cited the physical wear and tear that left him unable to play at the level that took him to five Grand Slam finals, including three losses to Roger Federer at Wimbledon,
He added: "I'm not ignorant to the fact that it's a huge part of me and that I won't miss it, of course I will.
Jonathan OverendBBC tennis correspondent
"It was a mighty fine career. Now a new life beckons and Roddick is bound to be a success in whatever field he turns to, which will surely involve talking, a lot of jesting and quite a bit of fidgeting. Good luck, Andy."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.