WhatsApp does not have a logout mechanism. You are automatically offline after 5 minutes of inactivity, but you will continue to receive messages without issues.
Just like Voice and SMS, WhatsApp is always on. We understand that this may raise concerns about battery life and data usage, but rest assured that we take these issues very seriously and strive to conserve battery and data as much as possible. We continue to make improvements in every version.