Turn off notifications in Messages on Mac
If you don’t want to get notifications each time there’s a new message in a conversation, you can turn on Do Not Disturb.
In the Messages app on your Mac, select a conversation, then click Details in the top-right corner.
Select Do Not Disturb.
To get message notifications again, deselect Do Not Disturb.
If you have a trackpad or a Magic Mouse, you can also swipe right with two fingers on the conversation in the sidebar, then click the Do Not Disturb button .
To turn off notifications for all messages, change your Notification preferences. You can also change the type of notifications you receive for messages (for example, playing a sound or showing a badge on the Messages icon in the Dock). See Receive, pause, or stop notifications on Mac.