I'm making a prison in a minecraft realm and found a post with a piston moving a block in circles, will the piston continue moving when everyone leaves?
Time in the sense of day/night cycle and weather passes while no one is on, however in all other senses time doesn't pass in a given chunk unless a player is online and nearby enough (although for a small set of chunks near the default spawn, "nearby enough" is anywhere in the Overworld). Source
So the piston should stop once everyone leaves.
Flying machines / redstone contraptions with slime/honey blocks at chunk borders break when chunks are loaded/unloaded. Source
When someone joins back and the piston is in loaded chunks, and if on chunk borders, they break, else they continue moving.