How to close Messages.app? I'm unable to quit or close Messages.app.

Even if I do Command+Q, I still see a popup message telling me that I received a message.

I don't want to disable notifications at all, I just don't want to receive messages while the application is closed. 

I haven't been able to do this? Is there any special/hidden setting to do it?
You can disable the notifications using Notification Center. Please note that they will be disabled whether the app is opened or closed.

Open System Preferences, then select Notifications (upper right corner). You will then see a list of Apps which use Notification Center. Find Messages in this list. Set the "Messages alert style" to None.