better to ask this to a local LEO or knowledgeable knife store owner, then do some legal research yourself and find the laws for your state, county, and city
The length depends on where you live, and other conditions.
In canada, it's 4". But also be aware that at 4" it's at the cop's discression as to it being allowed in a pocket or if it must be on a belt.
Really depends where you live.
Here in the UK it used to be 3", but the law was changed a couple years ago so that any edged or pointed tool can be considered an offensive weapon.
It varies from state to state, and from country to country, and then if you go onto a federal reservation there are more rules, but generally speaking you can carry a 3" blade just about anywhere. Let me put it another way, you can carry a 3" in more places than a 4".