like others have said; the logs are your friends here; but you can also help narrow it down. the next time it happens, see if you can confirm how your system has frozen by doing these things:
if it's well and truly frozen, nothing will happen when you tap the caps lock key; as in your key led won't light up or you don't get any response at all.
if it does light up; then it might be your xwindows environment and you might be able to switch to a virtual terminal. most distributions have setup alt+ctrl+f1 through f7 to let you switch to one of them and some distros have setup alt+ctrl+backspace to restart your xwindows. if you're in this situation, then it's a safe bet that an application is causing your problem and you can narrow your focus on the logs there.