Have a look at:
$ dmesg | less
If there is some problem with your hardware, or a bug in a driver, the kernel, or a module is loaded with the wrong parameters, you'll see a complaint in dmesg.
It might be the X11 server hanging and not the kernel. If that's the case, while the console will freeze the operating system will still be running just fine. You would then be able to log in over the network from SSH. This will work even if you are using wireless; run ifconfig in a terminal before the freeze to find out your IP address.
If it is a kernel hang, it would help a bit to diagnose it to check whether or not it answers pings. Sometimes crashed kernels do answer pings, which indicates that it's still handling interrupts and not totally dead. Knowing the answer to this won't fix your hang but could help isolate the cause of it.
You might have a bad build of some of your software. If that's the case most likely it would be a bad driver module that was not adequately tested after it was built by Ubuntu's release team. It could also be a bad build of an individual kernel or X11 server source file.
Bad builds that cause freezes or crashes are usually caused by code generation bugs in GCC. Code generation bugs are fairly rare but I have seen them happen. They can also occur more frequently due to incorrect build settings in Makefiles, or erroneous configure scripts that then generate bad build settings.
If you are a coder, try compiling a debug build of the kernel from source. Do a "make menuconfig" first (or the Ubuntu/Debian way of doing that for building .deb packages, whatever that may be), then enabling some of the kernel debugging options such as the Magig SysRq Key and kernel debugger.
Boot off that kernel, then if you still get the hang use the SysRq key to get into the debugger and do a stack trace. Post the stack trace here, and, if you think it really is a kernel bug, attach the stack trace to a kernel bugzilla and Ubuntu bug report.
If you aren't a coder, see if you can find someone who is to help you do that. Just about anyone who develops software on Ubuntu could build a custom kernel for you.