Can I use this CPU for gaming?

For gaming at 1080p (with some exceptions -like LOL for example) you will need a gpu, otherwise you will have to play on low-medium settings, and some games will not even work.
That being said, the 6400k has better integrated graphics than the intel- so yes, that one is the better of the two.
What is your budget though? We can make a build for you.
 
Here you go.
PCPartPicker part list / Price breakdown by merchant / Benchmarks

CPU: AMD A8-6600K 3.9GHz Quad-Core Processor (£68.39 @ Aria PC)
Motherboard: MSI A55M-E33 Micro ATX FM2+ Motherboard (£32.20 @ Ebuyer)
Memory: Kingston Value 4GB (2 x 2GB) DDR3-1333 Memory (£24.00 @ Amazon UK)
Storage: Hitachi Deskstar 750GB 3.5" 7200RPM Internal Hard Drive (£29.70 @ CCL Computers)
Case: Cooler Master N200 MicroATX Mid Tower Case (£28.64 @ Amazon UK)
Power Supply: EVGA 430W 80+ Certified ATX Power Supply (£29.98 @ Ebuyer)
Total: £212.91
(Prices include shipping, taxes, and discounts when available.)
(Generated by PCPartPicker 2014-05-09 16:42 BST+0100)
Went for the a8(more expensive) but it's a quad core and performs a lot better than the a6.
If you don't have the extra money, go for the a6.
Then when you want, you can add a discrete GPU.
 
If that is your complete computer budget, I would save up more money before putting together a gaming pc. Even if you are going to use an APU, you need to get higher clocked RAM to get the most out of the onboard graphics. 1866mhz or 2133mhz rated RAM.

Do you already have a PC/operating system/parts to work with?