In a word, Yes.
You have the option to backup the app or backup the app with data. So if you backup a game with data, it saves your current game state. If you backup facebook, it will save your login details (if you login automatically to facebook). You can also backup all your system data and settings. I'd strongly suggest purchasing the full version, as it's much more stable and easier to restore when the time comes. It's pretty much the only app I've ever bought!
You don't need to backup the Gallery, because the pictures are stored on the internal sd card, which does not get wiped when you do a full wipe / factory reset