If you are on android, you won’t be able to log out of WhatsApp. If your data connection is on, you will continue receiving messages.
But you can mute any conversations of particular contacts. But if you are on WhatsApp Web, you will be able to log out.