I'm trying my hand at making stats for a deity in D&D 3.5 (god of music, if it makes a difference) using the rules given in Deities and Demigods. So far everything makes sense except one thing: I can't tell whether or not his maximum number of class levels is supposed to be connected to his divine rank. Is there any sort of officially-stated correlation between the two, or should I just assume 40 or so levels like most core D&D deities seem to have?
There's no connection.
Deities and Demigods has a vague suggestion in the footnote on page 26:
Most deities are 20 HD outsiders with 30 to 50 character levels as well.
And that's it.
Just add as many class levels as you feel necessary to represent the "mortal" abilities of the deity.