The Versailles Treaty restricted Germany to hand guns with barrels no more than 98 mm long or else they had to be less than 100 mm, forget exactly which.
The standard issue Luger for the army had a 100 mm barrel, some versions longer, and the Navy lugers were longer. The only reason I can think of for the ban was to make it easy to distinguish commercial guns from military which were supposed to be surrendered. An exception were some police Lugers with 100 mm barrels which had the permission date of 1920 on the receiver ring when permission was granted by the Allies in 1920 for the German police to posses such.
The C96 was a secondary issue pistol for the army and most or all such had 150 mm barrels as issued.