It's easy to get wrong. But in general, the smaller punctuation marks—the periods and commas—are always included within the double quotes.
She said, "You're my friend."On the other hand, question marks, exclamation marks and the like should go after the quotes.
Do you like the phrase, "You're my friend"?But if the quoted material is itself a question, then the question mark goes before the quotes.
She asked, "Will you be my friend?"This is all well and good—if you're American. The English put the period after the quotes. And while we Americans cringe at the use of single quotes (unless within the doubles), apparently the English don't mind either way. And that's why my British mother gets away with both here.
While I'm left wondering, "What's the point of it all?"