The dropper post length is dependent on a couple of factors; the first being your saddle height and the second being the maximum seatpost insertion depth which you’ll find listed below. Using the values below and the charts supplied by the dropper post-manufacturer you will be able to figure out which dropper post length is best for you.
Altitude carbon 27.5" wheels:
Size S = 210mm
Size M = 235mm
Altitude carbon 29" wheels:
Size M = 235mm
Size L = 250mm
Size XL = 280mm
Altitude alloy 27.5" wheels:
Size XS = 225mm
Size S = 225mm
Size M = 250mm
Altitude alloy 29" wheels:
Size M = 250mm
Size L = 275mm
Size XL = 275mm