Close all open windows for an app: Press Option-Command-W.
Closing one or all windows for an app doesn’t quit the app — it remains open (indicated by the small dot below the app’s icon in the Dock). To quit the app, press Command-Q. See Tile windows on Mac