There are two schools of thought concerning the placement of a comma or a period when writing a quotation: American and British.
For Americans, who like to do things the easy way, the rule for placement is that periods and commas always go inside the closing quotation mark.
Some writers in the US follow the British style, which places the period on the outside of the closing quotation mark when it finishes a sentence and inside when it punctuates only the quoted material. The British always place commas outside of the quotation mark.
Adopting the American style allows less room for error — always place commas and periods on the inside of the closing quotation mark. Just remember not to mix the two styles in your writing.