The piston has a stop so it not going to come out of the cylinder of course.
But you need to be aware that if you have an older tractor with a lot of use (meaning old/dirty hyd oil), it is not uncommon for crud to build up in the "unused" portion of the cylinder (by "unused" I mean, if you had a 16" long cylinder and mechanically is restricted to 12" of travel, there would 4" of unused travel at the top of the cylinder where the piston never goes) it is likely that there is a build up of crud in the part where the piston is not traveling, so when you unhook the cylinder and run it out to max travel you are running the piston seals over this crud and that can cause a piston-seal leak problem.