The 9800 GT runs on a PCI Express 2.0 slot while your HP machine has a PCI Express x16. The video card will work on your PC, but it'll run at the slower x16 speed.
Your stock PSU may not have enough juice to power a computer with a high-end video card, so just check the output. If HP put in a weak 250W PSU, you'll need a new one.