That completely depends on the app. Some apps remain open without any windows. Some automatically close. Which behaviour are you asking for?
If you want to close the entire app, use Cmd-Q, like every other app in MacOS.
If you want to close all panes, but keep your vault open, consider using the command, Close all other panes
which will close all but one.
But it sounds like what you really want is to close your vault. @obsequious gave a good suggestion if you want to map Shift-Cmd-W. Google how to add app-specific hotkeys.
- Go to keyboard shortcuts
- Go to “App shortcuts”
- Click the + sign to add a new one
- Choose Obsidian, and type exactly “Close Window”, or if you are using a different language/locale, then you will need to type it exactly as the command is seen in your menu.
Unless I am not understanding, all the functionality is already there, so I am going to move this from “Feature Requests” to “Help”.