Everytime I listen to iTunes while playing online games on my computer, my computer will shutdown. It only happens when I'm online and listening to iTunes at the same time. It has happened 6x at least and 4 of the times, it was inbetween 12:00 and 1:00 am (approx. 12:40am)

Any ideas?
I have no idea, sorry. I'd say try rebooting but it sounds like you've kind of been firced into that a few times already.
My Gear
Fender Player's Stratocaster
MXR 10-Band EQ
Blackstar HT-Dual
Moog MF-103 12-Stage Phaser
Boss ME-50
MXR Carbon Copy
Peavey Valveking 112
Maybe you have something scheduled to reboot? Maybe an anti-virus update that needs to reboot afterwards? Check all your programs for that, and if you can't find anything, try a virus-scan or something. :/
You probably want to do a number of things to optimize your computer.

For one, if it only happens while your multitasking, you may want to Defrag your HDD.

You can do that in your drive properties.

Since it happens generally while your playing games, you may have a virtual memory problem.
While the best way to fix this is get a new graphics card, you can boost your video ram by converting space from your harddrive into virtual ram. This is called "Page file"

To do this, you go to my computer, right click>properties>Advanced>Performance Settings>Advanced. Then you want to click the button on the bottem that says change (It will be under virtual memory)

From here, choose one of your hard drives and click the button that says custom size. I recommend setting about 1000 - 1000 mb. Thats a GB.

You may also want to run scandisk manually to check your computer for errors. Beleive it or not thats usually what cuases these types of problems.
It's probably your processor and ram aren't enough to handle what you're doing.. try playing the game in low settings and no itunes and see if it happens then..

then play on low settings and try itunes and then do high and try itunes... it's probably that

Intel processors shut off when they're overheating.. I think
Check your CPU fan, mine was screwed and I had to use a fan too cool it off, I bought a new one and everything works fine .
I think its time to pack your things lets go,
To a place where we both know,
And dont worry, I'll drive real slow,
Spend some time before we go..
Quote by Haustinj
thank you all

i have an emachine. i try em and see what happens.

A quick google reveals Emachines have low quality PSUs which seem to have a reputation for failure. If you're under warranty, you could get it checked out.
It's probably due to overheating. My laptop needs a bit of a clean inside too.