The 29-year-old, who beat the big-serving South African 6-4 6-3 7-6(4), will play Canada's Milos Raonic next for a place in the quarter-finals.
Anderson, runner-up to Novak Djokovic last year, arrived at the All England Club after an injury-hit season due to a troublesome right elbow and his serve-and-volley game was derailed by a lack of sharpness at key moments.
Pella, the 26th seed, made a nervy start, saving two break points in his opening service game before settling into his stride.
He kept the 6ft 8in (2.03 metres) Anderson, the tallest man to play a Wimbledon final, guessing with a dizzying array of shots, including his backhand slice, and made 13 unforced errors compared to 29 from his opponent.
There was little to choose between the two in the opening set until Anderson's first serve deserted him with the score level at 5-5.
Pella turned the screws at the right moment and converted his fourth set point to claim the opener when the South African netted a forehand.
That rattled Anderson, who came out swinging at the start of the second set, but the 33-year-old's timing was off and Pella broke again to race into a 3-0 lead.
Anderson clawed a break back when Pella sent a backhand volley wide with the court at his mercy, but the Argentine broke again and served out the set to take a 2-0 lead.
Anderson, who hit 14 aces and 40 winners, fought on grimly to send the third set into a tiebreak, but Pella kept his composure, winning a stunning exchange of volley that brought the crowd to its feet to earn two match points before claiming the biggest win of his career.