Halep, 27, of Romania, broke Gauff five times and benefited from 29 unforced errors, ESPN reported.
"I'm really happy that I can play again," Halep told the BBC.
"I tried my best today but it wasn't meant to be ... thank you, London," Gauff wrote on Instagram stories, NBC News reported. The post showed Gauff grinning and waving as she left the No. 1 Court.
>> Who is Cori 'Coco' Gauff, the 15-year-old who defeated Venus Williams?
Gauff was facing a top 10 player for the first time, according to the Wimbledon website.
"I wasn't feeling 100% today. I still tried my best. Simona played really well," Gauff said during her post-match news conference. "I learned a lot. I learned how to play in front of a big crowd. I learned what it was like to be under pressure. I'm really thankful for this experience.".
Halep reached the quarterfinals for the fourth time, ESPN reported. She will face Zhang Shuai, of China.