In most cases, you can close a dialog with the same command used to open it. This applies to any combination of input methods, including menu, toolbar button, and keyboard shortcuts. For example, you can open the Render Setup dialog by choosing Rendering Render Setup, and then close it by pressing F10 (default keyboard shortcut). If a dialog is available from a menu, a check mark appears next to the respective command while it's open.
If a dialog is minimized, invoking its command opens the dialog, and invoking it a second time closes the dialog.
In addition, the keyboard shortcut Ctrl+~ (tilde) toggles display of any open dialogs, in most cases.
The dialogs affected by this functionality are:
One exception is Particle View, which is toggled by its keyboard shortcut (6), but is not toggled by the Modify panel Particle View button.