The Apple docs suggest to app developers that when closing the last window, the app should be made to close automatically. This is almost certainly what the user wants, unless you have a reason to think otherwise.
For example, as per my other comment, if I have restore tabs in my browser, I expect the tabs of the last open window to always be restored. Instead of this being a suggestion, it should be the default, and the developer should have to configure when they want the last window to NOT close the app. (Even Apple's Safari suffers from this!)
Also, Win has a dock for "background" apps which are always open, accessible, but not in the toolbar of open apps. Apple has a menubar, that similarly allows docking of those apps that are open without a window. My rule of thumb - if you don't think the app belongs in the menu, you want it to close when the last window closes. And if Apple had a "minimize to menu" that might be useful.