I am assuming this is an HP/Compaq PC?
If your 500W PSU has a +12V rail rated for at least 35A @ 400W, and if you want to avoid major CPU bottleneck, I would recommend either a GTX 960 or R9-380 as max. Any CPU bottleneck should be minimal in all but the most CPU intensive games. Keep in mind, online gaming of course will put more stress on the CPU than single-player gaming.