Why do T- tail airplanes have a shorter vertical stabilizer?
Two reasons:


T-tail design is often imposed on designs with twin engines mounted at the aft fuselage. This means they have a small moment arm in the yaw direction, the vertical tail is dimensioned to compensate for engine failure. The further away form centreline the engine is mounted, the higher the yawing moment that the remaining engine exerts upon engine failure.
The horizontal stabiliser at the top of the vertical stab functions as an aerodynamic barrier, like a winglet does. This prevents a vortex from streaming off of the top of the vertical tail when yawing, and thereby increases the effectivity of the vertical tail surface. This effect was researched in NACA TN 2907, at five different locations and three different spans:




The graph below shows calculated effective increase of aerodynamic aspect ratio, as function of where on the fin the horizontal tail is located. If completely at the top or at the bottom, the aerodynamic aspect ratio is about 50% higher than when at the centre, resulting in increase of the lift curve slope of the fin of roughly 15%.

With a T-tail, the horizontal stabiliser at the top functions as an aerodynamic barrier, while the fuselage at the bottom end provides some barrier function as well. Depending on the local fuselage circumference and shape of course.