In the Carnot cycle the overall work done on the piston is positive. I am having trouble with the real meaning of that. Does positive work mean the piston is moved up and has, over the course of the cycle, gained potential energy?
It is not the piston that the working fluid is doing work on. Over an entire Carnot Cycle, the potential energy of the piston does not change. But, if you were adding and removing tiny pebbles to and from the piston at its various elevations during the cycle, there would be net work done in increasing the potential energy of the pebbles.
The Carnot cycle uses an idealized heat engine to illustrate basic thermodynamic principles. Net work is done either by or on the system, depending on the direction in which it is run. As part of this idealization, the piston is massless and frictionless. The piston merely serves as a moveable impermeable boundary between the system and the surroundings—i.e., as an interface that allows the system to do work on the surroundings, and visa versa. The piston exerts no force of its own, so no work is done by or on the piston; the piston merely serves as a conduit for force exerted by the system or surroundings, and is not part of either.
To more specifically address your question, since the piston is massless, its gravitational potential energy is zero, independent of position.
Also, as this is a cyclic process, the system is returned to its original state at the end of each cycle, and thus the piston is returned to its original height. [Hence, as Chet Miller points out in his comment, even if the piston had mass, its PE would be unchanged at the end of each cycle.]