Ubuntu 16.04 Freezes often [duplicate]

Since it's a Gigabyte PC I presume it is Intel-based.
Look in the comment section for changing "intel_idle.max_cstate", in the following bug report: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1503731.

Another bug report in kernel bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=109051.

You can have a go in installing a newer kernel version kernel, I read somewhere this might be fixed in newer kernel versions(4.5 and up), here is a guide: https://wiki.ubuntu.com/Kernel/MainlineBuilds.

Hope it helped.

Edit:
Open terminal, Ctrl + Alt + T
Use sudo nano /etc/default/grub to open grub configuration file.
Replace the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

with this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"

Press Ctrl + x then "Y" (for yes, to save, and press enter), then type sudo update-grub, enter password if needed and press enter.
After Grub updated restart and hope it worked.

I also recommend closing the PCs if they are not needed, as this solution will only extend the duration until they freeze.