In some cases your institution may require you to temporarily turn off notifications during exams. You may also do this if you are worried something private or inappropriate might be seen by your institution when your screen is being recorded.
This feature is called Do Not Disturb.
You can toggle Do Not Disturb by clicking the Notifications icon while pressing the Option key. You can also open Notification Center and scroll down with your mouse or trackpad to reveal the Do Not Disturb switch. Click the switch to toggle Do Not Disturb on or off.
To set a specific schedule for Do Not Disturb, use the Notifications pane in System Preferences.