Punctuating dialogue can be more difficult than punctuating regular sentences, because it's not always clear when the sentence is over. After a character says something, is the sentence over? Or is the sentence over after you've told the reader which character spoke?
The answer is, both. It depends on what the character is saying. If your character is saying something simple (ie: one sentence) then you use a comma at the end, right before the quotation mark, and end the entire sentence in a period:
"What a cute dog," said Sally.
However, if the character speaks for a longer amount of time, you should consider breaking the dialogue up, like this:
"What a cute dog," said Sally, "It reminds me of the one I had as a kid."
If your character is speaking for a longer amount of time, but they are only speaking one sentence, do not capitalize the second part:
"But," pondered Sally, "is the dog for sale?"
And what if your character is excited? You're free to use an exclamation point!!!!!!
"I absolutely love that dog!" shouted Sally. (you do not need to capitalize "shouted" here--I know, weird).
The same rule goes with question marks:
"Can I buy that dog?" asked Sally.