Computer suddenly dies; screen displays weird flickering lines, then restarts
Most likely your graphics card has died. Typical cause for this is blown capacitors. Open up your computer case, take graphics card out and take a closer look at capacitors. If they look like these:
then it will be pretty obvious - just throw it away immediately and go to store to buy a replacement card.
Possible causes in order of probability:
Graphics card failure as @mvp mentions. It could be bad capacitors, it overheating (check for a dead or dust clogged fan), it not connected securely, or has sustained other damage somehow. This is assuming you have a discrete graphics card.
Try updating graphics card drivers.
If you do have a discrete graphics card, run the system and see if the problem comes back just running off the integrated graphics. If it doesn't you know it's a problem with the card (or possibly PCI-E slot).
While your motherboard is open check for bad (bulging) capacitors - any present could cause this issue, particularly if you've noticed other weird things like your system being inexplicably slow or not powering on reliably. If your system is dusty, clean it and see if that makes a difference.
I'd check for bad RAM next. If you have 2 or more modules, put 1 in at a time and see if the issue recurs. Furmark3d is a good free utility (I'm sure there are others) to stress your graphics hardware.
Your power supply may not be providing reliable power to your system. Try swapping it with another and see if the issue persists.
You may have another piece of failing hardware that's causing an issue. Remove any other expansion cards in your system and see if the issue persists. You could also try disabling any onboard hardware in the BIOS (Ethernet ports, etc.) and see if that helps, but that's unlikely to make a difference (if it does, replace the motherboard).
Update the BIOS.
Unlikely, but the CPU could be an issue. Try swapping it if you have a spare part around.
Replace the motherboard.