A PCI or PCIe card which is not solidly inserted, or which is inserted into the wrong slot, can prevent a system from powering on. A defective card might prevent the computer from passing its POST (power-on self test), which would result in a series of beeps (if there is a system speaker), and then stalling. Corrupt or incorrect drivers may cause the OS (Windows?/Linux?/Mac?) to crash while loading. This may also happen if the OS is unable to find a reasonable default resolution. In this last case, using a second video card to boot and configure the desired card may be useful.
A computer which repeatedly powers off is often one of two major hardware problems: overheating or faulty power. The first can be caused by broken or underpowered fans, or dirt or other obstructions. Also, an improperly installed CPU fan may contribute to overheating. The second can be the result of an uneven power supply (look into an UPS (uninterruptable power supply) to help with that) or a power supply that is not rated high enough (too few watts).
If the computer in question is running Windows XP and it turns off after displaying a message with a countdown, the problem is likely due to a common Windows XP issue with some of the key services being set to shut the machine off when the services are stopped. Pay attention to which service is mentioned in the message, and then go to the services control panel (right-click on My Computer, select Manage..., on the left choose Services), find the problematic service, and set it to restart the service instead of the computer.