I've already seen a level 10 Gym with 52k/50k so I assume that you can go higher
The intended maximum prestige appears to be 50,000, since 10 is the maximum level. However, being that this is Niantic Labs that we are talking about, there appears to be a related bug.
As noted in the answer here, the maximum prestige of a gym should be 68,000. The likelihood of ever finding an instance of this is probably very low, but it should be theoretically possible.
As stated in my answer here, the maximum prestige is actually capped at 50k. The maximum it will display is still 68k/50k, but even at that "level", if the first Pokemon is defeated, 18000 prestige will be removed plus the prestige removed for defeating a Pokemon.
So, while you are able to make a gym appear to have up to 68k/50k prestige, the game will not recognize prestige over 50k, and will behave accordingly.
The amount of Prestige you see is a combined total, unlike more typical EXP/Level bars where it would indicate EXP so far this Level.
The threshold ( /50k ) is therefore the amount of Prestige needed to reach the next level. However, since Lv10 is indeed the maximum level for the Gym there is no "next level" to indicate, and so it just shows the threshold that was needed for Lv10.
The actual amount of Prestige attainable appears to be unlimited, but so far there is no confirmed information either way.