What you are talking about is controlled by the System Value QINACTITV
This will sign off your session and job job is classified as DISCONNECTED.
When you sign back on, you should be right where you left off.
The next system value to look at is “QDSCJOBITV”
This value determines how long Disconnected jobs will be allowed to stay disconnected by the system ends the jobs.