Closing applications after documents are closed- OS X 10.8
If you want to disable showing an iCloud-centric open dialog when you for example open TextEdit or Preview, you can either disable syncing documents and data from the iCloud preference pane, or use this unexposed preference:

defaults write -g NSShowAppCentricOpenPanelInsteadOfUntitledFile -bool true


There are some third party applications like RedQuits that make closing a window quit an application. RedQuits only applies to closing windows by pressing the close button though. There is a noticeable delay before it quits an application, and it doesn't support excluding applications like Mail.

10.7 also added support for automatic termination, which as far as I know just means that applications that have no open windows are hidden from the Dock and the application switcher under certain conditions. If you for example open Preview, open at least one window in it, close all windows, and switch to another application, Preview is hidden from the Dock and the application switcher. The process is not actually terminated, but there might be some changes in how it is managed.