Some applications do not keep the screen on and the screensaver (or suspend) kicks in. (Video players such as mpv come to mind). In this case the little wrapper app “coffeine” comes in handy (source). Download the latest .deb file and install it with
sudo dpkg -i ./coffeine*.deb
Use it just by prepending it to the application you want to execute, e.g.
coffeine apt dist-upgrade
and the screen will stay on while you upgrade your system and won’t suspend in between.
UPDATE: Disclaiimer, it was written my me, so this is a shameless self-plug.