Keyboard Maestro has an IDLE() function that tells you how long the Mac has been idle (ie, no user input via mouse or keyboard).
If your Mac goes to sleep, then Keyboard Maestro will not be able to quit anything, so you need to ensure that your Mac stays awake long enough to tell that the Mac is idle enough to quit.
Assuming you want to wait until the Mac is idle 15 minutes, set the Mac to not sleep for at least say 30 minutes, and then set a periodic trigger to run every ten minutes and if the calculation IDLE() > 15*60 is true, then quit Papers.
The CPU/battery usage of such a slow periodic trigger will be negligible, although if you want bonus points, have another pair of macros:
Trigger on Papers Launches, action Enable Periodic Macro
Trigger on Papers Quits, action Disable Periodic Macro
If you want to consider Papers idle if it has not been in the foreground for 15 minutes, even if the Mac is not idle as such, you can add another macro:
Trigger on Papers launches, activates or deactivates, action Set variable Papers Last Used Time to NOW()
And then your periodic macro can first test if Papers is at the front and if so also update Papers Last Used Time, and then test the calculationNOW() - Papers Last Used Time > 15*60 and quit Papers if that is true.