Punctuation around dialogue is a pretty common sticking point for new writers, and this article does a very good job of presenting the various scenarios and how to handle them.
(I also recommend the entire blog, by the way – great articles for all skill levels.)