As long as the barrel (of a rifle) is at least 16" long, and the overall length is at least 26" long, you're good to go.

For shotguns, 18" min. barrel and 26" minimum overall are the required measurements.