Swift Quit enables automatic quitting of macOS apps when closing their windows (clicking the red x). It can be configured to quit when the last window of any app closed, or restricted to a specific list of apps. Additionally, you can exclude apps you dont want to quit automatically.
Some users have reported issues with unwanted closing of windows or other problems so use at your own risk.
https://swiftquit.com/downloads/Swift%20Quit.zip
https://www.youtube.com/watch?v=WwWF-yekX-U
In order to upgrade to a new version you must first remove the old version from Sytem Preferences => Security & Privacy => Accessibility. Then you can drag the new version in and enable it.