You will be automatically logged out of WhatsApp Web after 30 minutes of inactivity. When you sign into WhatsApp Web, you can check a box under the QR code which says keep me signed in. Then you will stay connected as long as WhatsApp is connected on your phone.
Why does WhatsApp keep logging me out?
Many Android smartphone users are being logged out of their WhatsApp accounts for no apparent reason. As per WaBetaInfo, this is due to a bug on the instant messaging app. “Your phone number is no longer registered with WhatsApp on this phone. This might be because you registered it on another phone.
How do I know if someone is checking my WhatsApp?
Go to WhatsApp Web and check the list of all open sessions. This will let you see all the devices that are connected to your WhatsApp. If you are seeing a message " This phone could not be verified", it means your WhatsApp has been accessed by an unknown device also.