The official numbers are:
- folder name - not more than 128 characters (123? see below)
- file name - not more than 128 characters (128? see below)
- total path to file - not more than 260 characters
And be aware that space and other special characters typically require three characters each. Ie. Test File is Test%20File
The page used to create folders and has a text box with a limit of 123 characters (go figure!).
The page used to edit properties for files has a text box with a limit of 123 characters, but that makes sense as Office 2007 has four character file extensions, so 123 + a period + 4 = 128.
And for completeness, here's the error message if you try to upload a file with too long of a name or a combined URL that is too long:
"The specified file or folder name is too long. The URL path for all files and folders must be 260 characters or less (and no more than 128 characters for any single file or folder name in the URL). Please type a shorter file or folder name."