Let's consider what will be the most cost-effective improvements you can make.
First, a new graphics should work fine. New entry-level and midrange Nvidia cards often need less power than, say, a GTX 460 from 6 years ago. This means your existing power supply can handle the load, no problem. Second, a new card will likely generate a bit less heat than your old one. This means if your case fans were providing enough cool airflow before, they will also provide enough airflow with a new graphics card. Third, for gaming, it's still the graphics card that provides the biggest boost to ensure good frame rates in your games. This means a new card will make most games playable at high-ish resolution and detail settings (depending on the game, of course). Fourth, your Core i3-540 will easily overclock to at least 3.7GHz with the stock Intel fan/heatsink, and it will go well beyond that speed with an aftermarket cooler in the $20 to $30 range if you wish. That speed boost on your cpu will give you several extra frames-per-second on most games. Combine that with an extra 4GB stick of RAM (for a total of 8GB) for a further small boost in fps and you have a system that will carry you for several more years. Fifth, even if you decide to buy or build a new PC next year, you can easily move the new graphics card to that new system. If it were my system i'd go for an Nvidia GTX1060 and an Arctic Freezer 7 Pro or Cooler Master Hyper 212 EVO cpu cooler. Both cpu coolers can handle a good overclock on the i3-540.
Recently my graphics card died thus I need to buy a new one. But my computer is 6 years old and I'm afraid that the new graphics card won't be compatible. Should I just buy a brand new computer or at least a new CPU and RAM or will the new graphics card work fine?
My specs: processor: Intel Core i3-540