Is AMD Radeon R7 240 2 GB DDR3 good for medium-high gaming?
My computer has an AMD Athlon X2 340 3.2Ghz, 1TB hard drive and 6GB of RAM.
Radeon R7 240
AMD Radeon R7 240 Benchmark On Battle Field 4
you should not expect miracle from Radeon R7 240 on some game you will have difficulty to switch anti-aliasing to high setting. If you plan to stick with this card for few years then perhaps to spend few dollars more to get a better graphic card so that to be able play new games.
Dalsan is correct about the graphics card. The linked test suggests that even on low settings it will be borderline for modern games.
However, I believe the bigger issue would be the X2 340 processor. I couldn't find a review from a source I'm comfortable to link but from what I read it's a pure 'office processor', usually compared to Intel Celeron and outperformed by the Intel Pentium G-Series CPU's.
If my information is correct this is an FM2 socket CPU so for gaming it would probably be wise to replace it with an AMD A8/A10 processor in addition to the GPU suggestions Dalsan made.
Unless one were to Crossfire the APU with a compatible GPU, and the motherboard supports it, sticking to an Athlon processor would be suggested. You wouldn't use the GPU side of the processor, anyways, so the cost savings from going with an Athlon X4 760K would be worthwhile ($90 USD vs $150+ for similar processing performance that fits the FM2 socket), and the processor can be overclocked. http://www.newegg.com/Product/Product.aspx?Item=N82E16819113348
This card is more of an entry-level gaming graphics card. You may be able to play older games on medium to high, but more modern games may struggle, even at low resolution and low video settings in the games. If you want better, but still cost effective, try the AMD Radeon 7750, though it will cost slightly higher. The R7 240 would use less power and may produce a little less heat, but would only be recommender for light to medium gaming at lower settings. The 7750 would be better for moderate gaming at decent settings, if not on high.
If you can, save up for either an R9 series or 7870 as these would offer moderate to high gaming capabilities with higher resolution and settings. Also, go for the Asus brand of "R" series graphics card as they offer higher frequency speed than most others (the R9 280 by Asus is close to speed as the R9 280X, but costs less).