That would happen in qbo, but in desktop, you have to manually log off.  there is no setting for automatic logging off after a specific time.

Resolution for 'after inactivity issue: 'logoff company file after inactivity' available: Yes.

The after inactivity issue or error code is a known issue in Quickbooks Online (QBO) and/or Quickbooks. Support for this issue is available either by self-service or paid support options. Experts are available to resolve your Quickbooks issue to ensure minimal downtime and continue running your business. First try to resolve the after inactivity issue yourself by looking for a resolution described in the article. If it is a complex after inactivity issue or you are unable to solve the issue, you may contact us by clicking here or by using other after inactivity support options.

For more information about resolving issues related to after inactivity in Quickbooks/QBO or to get support for the issue 'logoff company file after inactivity', click the link below: