Ok to be fair, the search function is not the greatest and although this has definately been beaten to death plenty of times I will indulge in the question.
For manual action shotguns i.e. pump/hinge/bolt, the barrel length can be as short as you want with the gun remaining non restricted AS LONG AS it follows these two conditions:
a) factory made
b) the over length of the gun remains 26" or greater.
Now if you want a shorty and decide to chop your own barrel you can ONLY cut it to 18" AS LONG AS the over all length remains greater than 26"
semi's are another issue which I am not sure about but I believe the barrel length has to be factory 18.5" with over all length at 26" or greater