You can use up to 31 characters to name files and folders in Mac OS 9.x, and all older OS versions.
In OSX, you can use up to 255 characters. Volume names are limited to 27 characters.
For all Mac operating systems, names cannot include the colon (:) character. This character is reserved by Mac OS to denote catalog hierarchy. A colon typed in a character name will be replaced by a dash (-) automatically by Mac OS.
You can find more details on files and folders on the Apple Web site at: http://docs.info.apple.com/article.html?artnum=25010.