In the FAQs it is mentioned that "Virtual machines are recycled when idle for a while, and have a maximum lifetime enforced by the system."
Are the maximum lifetime and idle times fixed or variable? Is there any way to predict them?
It's 90 minutes if you close the browser. 12 hours if you keep the browser open. Additionally, if you close your browser with a code cell is running, if that same cell has not finished, when you reopen the browser it will still be running (the current executing cell keeps running even after browser is closed)