Here is the Rules you have to use while battling them, they may also make they'r own rules.
Pokemon Levels cant be higher then the Gym Leader's Pokemon.
Do not use any One-Hit-KO Moves.
You have to follow the Gym Leaders's own Rules if they have any.