One reason I switched from Windows to OS X years ago was to avoid the constant barrage of Windows alerts and warnings. OS X is less of a pest than Windows in this regard, since it lets you control when and how you receive notifications.
Here are three ways to control when and how your Mac and its apps alert you:
1. Turn on Do Not Disturb
When you want to work uninterrupted for a stretch during the day, the quickest and easiest way to stop all notifications and their accompanying sounds is to turn on Do Not Disturb.
To do so, click the button in the upper-right corner of your Mac to open the Notification Center panel. Make sure you are looking at the Notifications view (vs. the Today view) and then scroll up to reveal the toggle switch for Do Not Disturb.
With Do Not Disturb enabled, OS X will halt all notifications and sounds for the rest of the day -- or until you go back to the Notification Center and toggle off Do Not Disturb.
2. Schedule Do Not Disturb
When you are working at night and do not want to wake a sleeping spouse or roommate, you can schedule Do Not Disturb to turn on for a block of time each day.
- Go to System Preferences > Notifications
- Click Do Not Disturb, which is the top-most option in the left panel.
- Next, check the box for Turn on Do Not Disturb From: 10 p.m. to 7 a.m. Those are the default times, but you can change the start and stop times.
There are also settings to enable Do Not Disturb when you display is sleeping or when mirroring your Mac to a TV or projector. You can also set two exceptions when Do Not Disturb is on, allowing calls to come through from everyone or only repeated calls, which means a second call from the same person within three minutes of the first call.
3. Set alerts app by app
While you have the Notifications window open of System Preferences, you can peruse a list of apps in the left panel and disable alerts for any app that you feel is overzealous in its approach to alerts.
For alert style, choose None to turn off alerts for that app. You can also choose between the smaller Banners-style or the larger and actionable Alerts-style notification.
You can also choose to allow an app's notifications to appear on the lock screen, in the Notification Center and as a badge app icon. There is also a check box to play sounds for an app's notifications.