Apple - How do I temporarily disable or mute Messages (iMessage) on OS X?
An update for Mac OS X 10.9 (Mavericks). You can turn on Do Not Disturb in Notification Centre to mute notifications:
You can show Notification Centre by clicking on the three-horizontal-lines icon on the far-right of the menubar, or perhaps by doing a two-finger swipe from the right edge of your trackpad (if this gesture is enabled in System Preferences -> Trackpad -> More Gestures). Then swipe up to reveal the 'Do Not Disturb' toggle (which is hidden at the top of the notification centre panel).
Update: I've also just discovered that you can option-click on the Notification centre menubar icon to toggle Do Not Disturb mode on and off.
Click your apple symbol in the computer -> System preferences -> notifications -> messages -> none
On the Messages menubar, go to Messages-> Accounts and uncheck iMessages.