You can download cheats directly from Retroarch:
You first need to open the RGUI. There are two ways of accessing the RGUI:
In the RetroPie menu of EmulationStation select Retroarch or
Use the default hotkey combo select+x to open the rgui from within a game
If you haven't done so already, you'll need to enable the advanced settings by navigating to Settings >> User Interface >> Show Advanced Settings, then enabling the Online Updater in View >> Show Online Updater
Next, navigate to Online Updater >> Update Cheats
this will download a set of preconfigured cheat files for many games into /opt/retropie/configs/all/retroarch/cheats
Or another option if you do not have internet
Download this:
http://buildbot.libretro.com/assets/frontend/cheats.zip
extract and put it on this directory: /opt/retropie/configs/all/retroarch/cheats
*dont forget before to Enable Cheats:
Choose Quick Menu >> Cheats >> Load Cheat File
Navigate to your game title and select it
Then navigate to the cheat you want to enable and press left or right to toggle it on/off
Select Apply Cheat Changes
Then press B to go out of the cheat menu and resume your game.
Your cheats should now be enabled