As a clarification to the above statement, the current idle time for MATLAB Online is 15 minutes, which is determined by user activity. For example, if you are running a script, but are still active in the session (even by something as small as moving your cursor in the active browser window), then you are considered not idle. Your script will continue to run for as long as you are considered not idle for more than 15 minutes. Your sessions can last for as long as this is the case.
I hope this helps!