The screen property OnHidden is triggered when closed, for single screen apps it would be as simple as:
Patch('Tracker', {timeLeft: Now()})
For multi-screen apps you could either make a session ID and update the session's timeLeft every time the screen changes or:
1. All navigation buttons set a 'leaving' variable to false
2. All screens OnView change this variable to true
Then if a user closes the powerapp, leaving will be true, as they are not navigating to a new page
If(leaving = true,Patch('Tracker', {timeLeft: Now()}))