Student Portal does not sign you out unless you click the user dropdown and select Log Out or if you close TestNav.
If you do not actively move or click your mouse for an extended time, an inactivity error appears and takes you back to the Tests page. You may see a note for that test, indicating that your teacher must resume your test (see 5b above).