* Punctuation belongs inside the quotation marks. The comma (or any other punctuation mark) goes inside the closing quotation mark if it's part of the dialogue itself.
* Dialogue is a complete sentence. A sentence in dialogue needs a period at the end, even if it's part of a larger sentence.
Example:
"Hello," she said. "How are you?"
* "Hello," is a complete sentence, ending with a comma inside the quotation marks.
* "How are you?" is another complete sentence, ending with a question mark inside the quotation marks.
Incorrect:
"Hello," she said,
This is incorrect because the comma is outside the quotation mark.