Gym Challenge is unlocked at lvl 50. In this game mode you can earn yourself Gym Points so that you can level up and refine Gym Skills to get Stats. These stats are applied to all of your pokémon.
First we have the Server Gyms (thumbnail). There are 8 Gyms that can be defended by players, and whoever holds those gyms will earn some extra Gym Points over time.
Each one of those Gyms have 4 enemies that you can defeat. Leveling up the Gym Skills of the previous Gym will make your battles much easier.
Once you defeat the 4 players you can unlock the next Gym. The Gyms that you already completed can be raided every day, and will provide some Gym Points, a Skill Core Box and 10 Diamonds for each Gym.
Each Gym Skill that you level up provides stats. Also every 10 levels you can unlock a Core Slot. Cores provide % Stats, and can be obtained from the Skill Core Box.
Once one of your Gym Skills reaches lvl 50, you also have the Option to Refine. Refining costs Gym Points and it's one of the biggest sources of stats in these levels.
All the 8 Gym Skills can be Refined. The Max level of the Gym Skills is 100.