By default, the provided X does close the application but it keeps running in the background while consuming RAM. To quit the app entirely, you need to select the app from the top bar, press Command + Q, or click on quit from the Dock. If you want to have a Windows-like function which closes any application when the Red X gets clicked, do the following: Go to System Preferences, and under the General section, uncheck the option which says "Restore windows when quitting and re-opening apps.” This will ensure that all instances of a closed app get halted. However, if that does not work for any reason, you can install the RedQuits application. Once the app is installed, uncheck the option that says "Quit only when one window is left for that app.” Now apps will terminate when the Red X is clicked.