Time your attacks wisely
According to the data provided by Redditor alancaesar, the Pokémon you face at a Gym will attack every 1.5 seconds -- without fail. Use this information to nail the timing of your dodges, and you'll have a leg up every time you battle.
Keep those attacks basic
Due to the aforementioned timing, the bulk of your attacks should be basic; tap like crazy, get your dodge timing down, and you won't need those special attacks until you've already established a firm lead in the battle.
Don't power up your Pokémon
That's right: until you're level 20, you really shouldn't be powering up any of your Pokémon. Like, at all. As Kolrich explains, players will continue to encounter more powerful Pokémon as they level up -- meaning that once you find a 300cp Squirtle, that 100cp Squirtle you powered up becomes obsolete. In reality, the smart move is to hoard your stardust until you reach a sufficiently high level before blasting them with angeldust. Sorry, stardust.