To close a window just click on its CLOSE (red eXit) button, located in the top-left corner of the window. On a Microsoft Windows computer if the window belongs to a program that has multiple windows open, such as Microsoft Word 2010 or Paint, only the window whose CLOSE (red eXit) button you clicked on will be closed. It is only when you are closing the last window of that program will the entire program (software) terminate thereby releasing any resources (Graphics, Devices and so on) it was using.
If a program only uses one window then that window will be closed whereby its associated program (software) will then be terminated and its resources released. On an Apple Mac computer the CLOSE (red eXit) button and windows in general work differently.
On an Apple Mac computer, depending on the application (program) and/or window in use, when you click on a window's CLOSE (red eXit) button it will either close that window only whereby its associated application is still running in the background, for whatever reason(s), or it will close both the window and its associated application together with any resources it may of been using such as Memory.
As an example: If you only have one Microsoft Word 2011 window open, displaying the contents of Document1 for example, and click on its window's CLOSE (red eXit) button only the Document1 window will be closed - Its associated application (Microsoft Word 2011) will still be running in the background just in case you decide to open another Microsoft Word 2011 document file, in which case that other document file will be displayed in a new window. And this is one of the main premises of the OS X (Sierra) operating system; to keep applications running (open) in the background just in case they are needed again, which has advantages and disadvantages like anything else.
Fig 1.0 Click on the CLOSE (red eXit) button to close the Document1 file.
In the above example I am closing a Microsoft Word 2011 document file, called Document1, by clicking on its window's CLOSE (red eXit) button. When the Document1 window has closed the docked icon belonging to its associated application (Microsoft Word 2011) remains on the dock with its Indicator Light still glowing (Fig 1.1 below). This means the associated application (Microsoft Word 2011) is still open (running) in the background even though one or all of its document windows have been closed.
The purpose of this is so that you can quickly open a new document file (window) and display its contents without having to relaunch the whole application again, from scratch. It just saves time not to keep closing down an application and relaunching it every time you need to open a new document file (window).
Fig 1.1 The glowing Indicator Light underneath a docked icon means that app is still running in the background
If a docked icon has no glowing indicator light underneath it, perhaps because the SHOW INDICATOR LIGHTS FOR OPEN APPLICATIONS setting (Dock preference) has been switched off, you can still check whether or not the application is open (running) in the background by right clicking on its docked icon. If you see the QUIT menu-item it means the application is still running in the background.
Clicking on the QUIT menu-item will first close any remaining opened windows associated with the open application before it then shuts down the actual application. So in Fig 1.3 below the open window displaying the contents of Document1 would be closed before the Microsoft Word 2011 application itself was shutdown.
You know there is a window open that is displaying the contents of Document1 because Document1 is listed as a menu-item in the docked icon associated with Microsoft Word 2011. In Fig 1.2 there are no document windows open, so clicking on the QUIT menu-item would simply shutdown the Microsoft Word 2011 application only. And in Fig 1.4 there is no QUIT menu-item, only an OPEN menu-item, meaning the application called Microsoft Word 2011 is no longer running in the background and can therefore only be OPENed.
Fig 1.2 Right click on a docked icon to see if its associated application is still running in the background
Fig 1.3 Click on the QUIT menu-item to close the Document1 file and shut down Microsoft Word 2011
Fig 1.4 The Microsoft Word 2011 application is no longer running in the background - It can only be OPENed.
So to clarify: If you see a QUIT menu-item or EXIT menu-item, it usually means the application associated with the file being closed is also shut down. And if you just see a CLOSE menu-item, you can assume the file has been closed but the application is still running in the background.