Well, you need to do some research here really. Like will your PSU be big enough or will the stock heatsink that came with your computer be big enough.
Hp used some very generic motherboards that sometimes are hampered or below normal usage specs. The BIOS's that HP uses are usually missing critical settings for many things that are needed to upgrade or even overclock. Thats because they prefer you to buy a new system instead of upgrade.
If you are serious of upgrading to something more current, look into building your own system vs buying a new one from HP. Some of the new laptops are starting around $500 or check youtube to build one for the same price. Explore your options before committing to upgrade an HP.