Those are two different questions with two different answers, so it is worth splitting them.
For gaming the graphics card does most of the heavy lifting, followed by the CPU. A dual-core processor will manage older titles, but modern games want four cores or more since so much work is handed to the machine at once. If you plan to overclock, budget for a decent aftermarket cooler as well, because heat is what limits sustained performance.
For browsing none of that matters much. A modest CPU, 8GB of RAM and an SSD make the biggest difference to how a browser feels, and the SSD is the single upgrade most people notice.