There are multiple answers to this question based on what your refernce points are. From a simple perspective, carbine length handguards are 7", mid-length are 9". Gas port position would be slightly beyond the end of the HG.
From Armalite's data, the length of their gas tubes for carbine and mid-lengths are 9 3/4" and 11 3/4" respectively. Note that the gas tubes extend rearward of the barrel extensions a bit, so from a HG perspective we're measuring from the delta ring forward, and from a gas tube perspective, we're measuring the length of the tube.
Finally, not sure if Armalite is consistent with the rest of the industry , and for that matter, while I'm under the impression that the industry has standardized port locations on carbine-length gas systems, I'm not sure if there's industry agreement on mid-length systems. I would need to hear from an industry SME regarding the latter.