“I played well especially on the pressure points,” said Gauff.
“I’m just still shocked that I’m even here. I think I can beat anyone. If I don’t think I can win the match then I won’t even step on the court.”
Four-time champion and world number one Djokovic hit 13 aces and 37 winners as he eased past Denis Kudla of the United States, 6-3, 6-2, 6-2.
“I’m pleased with my game overall. There were some moments in the match where maybe I could have done better,” said the defending champion.
“But overall, a solid performance.”
Djokovic goes on to face Hubert Hurkacz for a place in the last 16 having defeated the Pole in straight sets in the first round at Roland Garros in May.
Victory in that match could see him face 18-year-old Canadian Felix Auger-Aliassime, the youngest man in the draw.
The 19th seed saw off French qualifier Corentin Moutet 6-3, 4-6, 6-4, 6-2 to make the third round of a Slam for the first time.
Last year’s beaten finalist Kevin Anderson, the South African fourth seed, also progressed with a 6-4, 6-7 (5/7), 6-1, 6-4 victory over Janko Tipsarevic of Serbia.
Three-time major winner Stan Wawrinka fell in five sets to 6ft 11in (2.1m) Reilly Opelka.
Two-time quarter-finalist Wawrinka, 34, was beaten 7-5, 3-6, 4-6, 6-4, 8-6 by his American opponent, the tallest man in the sport and 13 years his junior.
Opelka fired 23 aces and 59 winners and goes on to face 2016 runner-up Milos Raonic of Canada.
Opelka will be appearing in the third round at a Slam for the first time having never won a grass court match in his career prior to coming to Wimbledon.
Wawrinka won heartfelt applause for giving a line judge a warm embrace after accidentally colliding with her as he sprinted to hit a backhand.
“I was a bit too far to return a serve. I think I went against her, so I was sure she had some pain and was not happy, so I gave her a little hug,” said the genial Swiss.
Also feeling the pain was Russia’s Margarita Gasparyan who was forced to retire when just two points from victory against Ukraine eighth seed Elina Svitolina.
World number 62 Gasparyan was 7-5, 5-4 ahead when she collapsed to the ground on Court Three, suffering with cramping.
Although she bravely tried to continue, the Russian, who has undergone three knee surgeries in her career, was forced to quit.
‘Unfortunate for her’
“I was a little bit shocked, it’s never nice to get this when someone is injured like that,” said Svitolina who goes on to face Greece’s Maria Sakkari for a place in the last 16.
“It’s really unfortunate for her.”
Spanish veteran Fernando Verdasco staged the comeback of the day when he recovered from two sets and 3-0 down to defeat British number one Kyle Edmund 4-6, 4-6, 7-6 (7/3), 6-3, 6-4.
Czech third seed Karolina Pliskova reached the last 32 with a 6-0, 6-4 win over Puerto Rico’s Olympic champion Monica Puig.
Pliskova, one of four players who could end Wimbledon as world number one, will face Hsieh Su-wei of Taiwan for a spot in the fourth round.
Former world number one and double Australian Open winner Victoria Azarenka swept past Australia’s Ajla Tomljanovic 6-2, 6-0.
Azarenka, now at 40 in the world, was a semi-finalist at the All England Club in 2011 and 2012.
Next up is a last-32 clash with fellow ex-world number one Simona Halep who defeated fellow Romanian Mihaela Buzarnescu 6-3, 4-6, 6-2.
“We have had very tough matches in the past,” said Halep, who beat Azarenka at Wimbledon in 2017.