Those are the relevant measurements as they pertain to your Jeep. Correct shock length depends on weight, spring rate, manufacturing tolerances, and intended use. First choose springs. Ideally it's best to install the springs, measure the distance between shock mounts, then subtract prospective shock's compressed length, the remainder is the available compression stroke length at-rest.
Examples for the rear, RS55241 has 8" of travel, ideal resting height is 4" of compression, and 4" of extension. If the remainder from the at-rest calculation is 5.5", there's not enough distance for extension; the shock is too short. This would be the case if the spring rate was very high, or the Jeep had a soft top, no rear seat, and no spare tire. For that example RS55256 with 9.625" of travel is an appropriate model option.
Example for the front, RS55239 has 9.410" of travel, if the at-rest calculation yields 3.5" for compression, the shock is too long. Because Jeeps have generous forward rake, a two-birds-with-one-stone solution would be to add a .75" spacer above the stock spring isolator.