That happens when Diablo times out from the chat server (games are on a different server and unaffected until you leave). Your friends will also see you 'log off' while you are still playing, and bnet commands such as /time, /w, /f msg etc will no longer work.
I'm unsure of the cause of this, however I believe it may be related to chat 'inactivity'. To try and avoid this, every 5 minutes or so, type in a bnet command such as "/time" or "/users" (or whisper friends) to help try and prolong the connection.
This also can happen on PCs and is not a Mac specific problem. Firewalls are generally the first to be blamed, however I don't believe this is an issue in your case. There are no diadvantages of this occuring apart from the fact you will not be able to whisper friends and they will not be able to see you are online until you rejoin.