Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
RedQuits "All programs now quit and close all open windows if you click the red button."
http://www.carsten-mielke.com/redquits.html

Swift Quit "Swift Quit enables automatic quitting of macOS apps when closing their windows (clicking the red x)." https://github.com/onebadidea/swiftquit

Similar and related threads
“Quit app by pressing the red dot?” https://forums.macrumors.com/threads/quit-app-by-pressing-the-red-dot.2395078/
“I wrote an AppleScript that Quits all running apps at once!”
https://forums.macrumors.com/threads/i-wrote-an-applescript-that-quits-all-running-apps-at-once.2379603/
Quick Action to Quit All Applications https://forums.macrumors.com/threads/how-to-close-apps-in-mission-control.2371321/post-31754914
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.