A service that takes forever to stop is a classic reason a reboot hangs. I’d rather know where that wait comes from than blame the shutdown screen. In systemd it is one line in the unit file.
[Service]
TimeoutStopSec=30s
According to systemd.service(5), this is the time systemd waits for each ExecStop= command. If a stop command times out, the remaining ExecStop= commands are skipped and the service gets SIGTERM. If it still has not stopped when the time is up, it is killed with SIGKILL. Without the line, the default comes from DefaultTimeoutStopSec= in the manager configuration.
You rarely need to edit the original unit for this. A drop-in does the job:
sudo systemctl edit myapp.service
Put the two lines above in the editor, save, and restart the service to be safe. A database or a container that has to flush data to disk is a good reason to give it more time, say TimeoutStopSec=2min. A small helper that ignores SIGTERM is a good reason to give it less.
The value infinity switches the timeout off. I’d think twice before using that: a service that never stops can then block a shutdown for good.
One caveat: a service of Type=notify can ask for more time by sending EXTEND_TIMEOUT_USEC=, so the real wait can be longer than what you set. And if a watchdog aborts the service, the wait is governed by TimeoutAbortSec=, which falls back to TimeoutStopSec= when it is empty.
Further reading: systemd.service: TimeoutStopSec=