>>51704806Gym mons will decrease in cp the longer they are in the gym, so you should wait until it looks like their heart is empty before attacking. As for powering up your mons, do an IV check before hand with the Appraise Pokémon button in the list of options on the side of the screen when viewing a mon.
As you level up the power of wild Pokémon will increase with your level, so I'd say avoid powering up mons until you're a little higher level. Save any 3* or higher mons you catch, and transfer the rest unless they're your faves. As for guides, I don't know of any, but there are probably hundreds on YouTube.
Oh, and leveling up is just powering them up with stardust, stardust is the main currency of the game that actually matters, you'll earn it every time you catch a mon, also you get some from opening gifts and defeating team rocket grunts.