I am getting my coins, but the 1,000 xp for being in a gym is not showing up on my xp count. Does it show up at a different time than the coins?
You get some XP from battling in a gym, although this amount is really minor.
Battling in Gyms will give you XP points - 50XP for sparring in a friendly gym, and 150XP for a battle in a rival Gym - making it not a decent way to earn experience.
This information seems depricated on the other hand. But it looks like it has some links to the number of reputation you give or take from a gym.
But you do not get any XP from staying in a gym as Frank said.