We need more details. What HP system do you have? What are its specs (CPU model, motherboard model if available, the PSU's wattage, etc.)? How much are you looking to spend? How much room do you have in the case for the video card? What GPU do you currently have, and can the board support a second one?
I will say that it may not be possible to replace the GPU without basically gutting the machine. It's likely you'll have to replace the PSU, and maybe even the motherboard and CPU, depending on the age and other factors. Right there, you're already looking at the majority of the machine. It's only a couple hundrend away from an entirely new build.
The other possible problem is that many prebuilt vendors use proprietary parts. That means you can't use aftermarket parts with their machines. This is usually limited to the motherboard, but can include the case, PSU and graphics cards. If the PSU is proprietary, it could be an unusal size (physical size), which means you can't replace it. Considering that it's extremely likely that the PSU included can't handle a fairly meaty video card, that's a deal breaker right there.
I should also say that great gaming builds can be built for under $500, and get extremely good performance. Once you get up to $700-800, you're looking at a machine that will handle any game at any resolution with maximum details. What I'm saying is that even if you don't think what you've got is enough for a gaming build, it could be if you put in the effort to build it yourself.