The PTO drive is shown to be about 14" in front of the draw bar pin in my reference material and with my tractors...pretty close.
Measure the distance from the PTO end to the drive shaft on the mower gearbox.
Since the most the mower can raise up and not jam the PTO is 14" then that is the maximum travel from the level position . Give yourself a couple of inches of slack for a total of 16" and subtract that from the measurement you made from the PTO to the gearbox drive shaft. That is your answer.
Both the outer and inner parts of the shafts should be about the same length and ensure that when mating that the shafts are keyed so that the joints work in unison; i.e. when you move the PTO coupling to the side both joints move in unison allowing the movement.
That works for me.