Message preferences
Go to your My courses-page and click on Preferences below your name.
Choose Message preferences in column 1. These settings will apply to the Moodle messages (similar to Whatsapp or Facebook Messenger).
Recommended settings
If you use messaging moderately, the recommendations below are suitable for you. Choose OFF with email/online. If you put the notifications on while you're online, you will get an email telling you have a new message even if you were logged in to Moodle at that moment and were having the conversation with a peer. However, it may be useful to have an email notification of a received Moodle message when you are offline. If you send a lot of messages and often spend time online in Moodle, consider putting both email notifications off.
It is recommended to log in to Moodle regularly and to keep the notifications mostly within Moodle. The alert badge notification in Moodle is quite enough and while you're working online in Moodle it lets you know instantly when somebody has sent you a message. The notification itself is a small numbered purple ball next to your avatar image. If these push notifications annoy you and if you check your Moodle messages anyway, then select OFF in all of the spots below.