"According to RFC 952, the following are the assumptions: A "name" (Net, Host, Gateway or Domain name) is a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-) and period (.). Note that periods are only allowed when they serve to delimit components of the "domain style names". No blank or space characters are permitted as part of a name. No distinction is made between upper and lower case. The first character must be an alpha character."
To summarize, a maximum of 24 alphanumeric characters plus hyphens. No underscores or spaces - useful to know when devising naming conventions.