As stated in this thread, Ubuntu 18.04 looks like it has some trouble with AMD Ryzen 5 integrated graphics controllers, where Ubuntu freezes occasionally, including the mouse. I can prove this issue for also dedicated graphics controllers (RX570).
There must be an probably undocumented issue with the new Wayland or what so ever. The result of this question should be to collect enough information or a solution to file a bug report against the community.
The user @SD has solved the problem in switching the environment to metacity
(sudo apt install gnome-session-flashback). He says that this issue could not only be related to just internal GPU's.
Also, which environments might work besides the mentioned ones?