Answer:
There are no rules per se -- just use proper punctuation. Characters speak differently, and each of them will have individual ways of talking. In general, avoid trying to use fancy synonyms for the word "said," though -- it makes the reader stop reading to try to figure out how the character is talking. Just say "he said," "she said," or "he asked."