(Are you using X11 when this happens or are you switching between text consoles? Is your kernel tainted i.e. do you have any binary drivers installed?)
First, install all Ubuntu 8.04 updates (esp for the kernel) and test if the problem disappears. Probably you're not the first who runs into this (esp with this old distribution) and maybe there is already a fix available.
If the problem persists decide between trying the upgrade to Ubuntu 9.04 (the easy way) or trying to find the culprit of the problem (a little bit harder) by capturing a kernel panic: Connect your machine with a serial cable to a second machine (see Documentation/serial-console.txt in the kernel sources for an explanation). Alternatively you can try to capture the panic with netconsole (which sends the kernel panic as a UDP packet to a 2nd machine). Google "netconsole" and you'll find explanations how to do this.
Now, if you manage to capture the panic post the entire panic message here and chances are not bad that we'll be able to determine the culprit (you could e.g. search at kerneloops for the function name that appear at the top of the call trace or at the instruction pointer (EIP) address).