You can't directly logout of WhatsApp on iPhone or Android, but you can delete the app or clear its data to essentially accomplish the same thing.