WhatsApp Web session doesn't expire on connected devices even if your phone is offline. Once WhatsApp Web is connected successfully, it will work continuously on the linked device(s) unless you log out from your device or phone manually. However, do note that the linked device(s) is logged out if you don't use your phone for more than 14 days.