Quotation marks are very useful punctuation marks, but the grammar rules that come with them are complex and numerous.
Let us start with the basics. Quotation marks are used to indicate that a particular piece of text has been taken from another source. They also indicate when a character is speaking — they convey dialogue. "Salutations! How are you doing today?" asked the boy.
Note that when a quote is placed inside another quote, use apostrophes rather than quotation marks for the inner quote. "He said, 'I don't think so,' but he was lying."
If inserting something into the quoted material that wasn't there before (or even just to capitalize a letter that was lowercase in the quote), use brackets to indicate that this addition was not part of the original quote. "I think this book is amazing." would turn into "[T]his book is amazing."
If omitting a portion of the quoted material, use an ellipsis to indicate that something has been removed from the quote. "This book, in my opinion, is an insightful commentary on human nature." would become "This book... is an insightful commentary on human nature."
If a quote ends in a question mark or exclamation point, that punctuation mark will never change. However, if a quote ends in a period, that period will change to a comma if inserted into a larger sentence.
Example 1: "I went to the bank."
Example 2: "He had an alibi. 'I went to the bank,' he said."
See how the period becomes a comma? That's not even the extent of the quotidian yet quintessential quirks of quotations.
The lines of quotes begin to blur when they are inserted into larger sentences. This is due to a discrepancy between British and American English. In British English, the comma or period that concludes the quote will only appear inside the quotation marks if the quotation is a complete sentence. In American English, the comma will always be inside the quotation marks. Take a look at these examples.
American English: The word is "whom."
British English: The word is "whom".
American English: I told her that she should have said "whom," but she didn't care.
British English: I told her that she should have said "whom", but she didn't care.
Did you know that quotation marks are different in other languages? In French, for example, punctuation marks known as guillemets are used to express dialogue. They look like this: « »
The wonders of punctuation may never cease, but this article must. Thus, let us end with the immortal words of "Weird Al" Yankovic, taken from his hit parody Word Crimes: "One thing I ask of you... Always say 'to whom,' don't ever say 'to who' / And listen up when I tell you this / I hope you never use quotation marks for emphasis!"