When you want to close a file quickly, click on the close icon in the document tab. You may also use the Close icon in the main tool bar, or the File → Close (Ctrl+W) menu item.
If the file is unchanged, it is merely closed. If the file has been modified, you will be presented with a save dialog.
When dealing with multiple files, you may want to use the File → Close All (Shift+Ctrl+W) menu item.
For each modified file, you will be presented with a save dialog, where you can choose to save the changes, close the file (i.e. discarding any change), or cancel the operation.
Note that the File → Close Window menu item offers the same behaviour.