For evey new mon on a gym, the prestige rises for 2k.
If someone prestige a gym to 50k with only one mon defending, it'll have 9 open slots. When more people come to fill the slots, the gym can go up to 68k prestige.
But... every prestige past 50k is counted as 1k and will go back to 50k if you defeat a single mon. So, if you beat one mon from this 62k gym, it'll go to 50k.