Hi,
I don't have an answer for this one.
I thought it might be something in the Notification settings in System Preferences.
However it seems "Do Not Disturb" can only be set if the Screen is Sleeping (implying that full sleep is not covered in this setting).
Sleep does cut all Internet Connections so in that sense the App is "Cut Off" at that point.
However the Server is the one pushing the iMessages to the device. It should continue to do so until the device "accepts" the iMessages.
I would also check the ID or iPhone Number of the incoming iMessages you are getting and check that the Mac and iPhone are syncing properly.
I do realize you have not mentioned and iPhone or iPad but I am just mentioning ideas.
If the iMessages you are getting are aimed at an iPhone number and the Mac is set to Receive them as part of the sync process there could be an issue.
If there was an iPhone but it is no longer doing iMessages (or the setting there has lost the iPhone Number) then it is possible that the iMessages to the iPhone number on the Mac will only work when it is logged in (sleeping logs you out).
9:50 p.m. Thursday; September 3, 2015
iMac 2.5Ghz i5 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad