That does not seem like normal operation. I can think of two situations that could fit your case:
1.) The display manager freezes, and will not respond to anything
2.) The machine’s experiencing such a big load it can’t answer to anything in a timely manner.
In case 1, you can still access your machine with ssh (we have a guide on enabling ssh on Ubuntu 18.04). In such a freezing situation, if you are able to log in with ssh, and the system does not show high load or swapping, the graphical session should be investigated further.
In case 2, you may not be able to login even with ssh, but you would get at least an error message that would help us getting closer to the root cause. A machine that is completely frozen will not respond to even a ping request, while an overloaded one should, given enough time. Also in this case you should hear the cooling fans as loudly as possible for the given model.
In either case if you are able to log in with ssh, you can query system load with the
uptime command, and check memory usage with
free to see if some resource is to blame about the situation.