I have found some evidence that your processor is affected by the c-state bug which causes total freezes when the CPU tries to enter an unsupported sleep state. It's a problem for many Bay Trail devices especially with newer kernels.
There is a simple workaround for this until it gets properly fixed upstream. You just need to pass a kernel boot parameter and the random freezing stops completely (so if you still get freezes after doing this, you will know your problem is something else)
You do this by editing the configuration file for GRUB:
Boot Ubuntu and open a terminal by pressing ctrl+alt+t then type
sudo nano /etc/default/grub
Find the line GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
This needs to be changed to include intel_idle.max_cstate=1
So after your edit it reads
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
If you have other boot parameters already besides quiet and splash, just leave them alone.
Now save the file by pressing ctrl+o then enter and exit by pressing ctrl+x
Now type
sudo update-grub
Then reboot
What to do if you don't have enough time to do this before the system hangs
No problem. As explained on the help page I linked to earlier, you can add the parameter to GRUB before booting. Note that this only passes the parameter for this boot, so you still have to edit /etc/default/grub once you have booted to make the change permanent.
You need to get to the GRUB menu. If you are dual booting this will appear anyway, if not you have to press and hold (or tap) shift after pressing the power button to turn on.
When you get to this screen press e and you will go into edit mode, looking vaguely like this
Move the cursor down to where it says quiet splash
, put a space after splash and carefully type intel_idle.max_cstate=1
making sure there is a space after it as well. Now press F10 or ctrl+x to boot.
sudo update-grub
– Zanna Jul 05 '16 at 20:20sudo fdisk -l
you should find the right /dev/sd[letter][number], for example /dev/sdb1 – Zanna Jul 05 '16 at 21:04