With dialogue punctuation, the important point, as with any aspect of writing, is to be clearly understood. You’re going to blunt the emotional impact of your fanfic epic if your reader can’t figure out what’s going on, and there are agreed-upon conventions to make sure that your reader is paying attention to your story rather than going, “Say what?” Jim and Blair from “The Sentinel” will assist with examples.
When you write, dialogue should be enclosed with double quotation marks, thus:
“If you expect conversation this early in the morning, there’d better be coffee,” Blair said.
Note that the dialogue tag, the part of the sentence that tells you who’s talking, is part of the sentence, and that a comma helps to separate Blair’s speech from the tag. Don’t use a period/full stop.
“The line at the bank was hell.” Jim said.
“The line at the bank was hell,” Jim said.
Other punctuation that directly relates to the dialogue in question should also be within quotation marks:
“How much will it cost to fix your truck?” Blair asked.
Jim fixed the hostage-taker with a glare. “Let go of the child!” he shouted.
Sometimes, dialogue punctuation follows a different format. For example:
Blair did a double-take. Did Jim really just say, “Chief, I like doing your tests”?
In this case, the question mark is outside the quotation marks because Jim’s remark was not itself a question.
Sometimes the tag is placed in the middle of the dialogue, or perhaps the writer wants to insert some action rather than a tag:
“The line at the bank,” Jim said, “was hell.”
“Are you telling me,” Blair’s eyebrows rose, “that you like doing tests?”
Where you've interrupted speech with action, some authorities suggest the following:
"Are you telling me" - Blair's eyebrows rose - "that you like doing tests?"
If a character is reporting somebody else’s words inside their speech, then single quotes are used to enclose the reported speech:
The prosecuting attorney gave Blair an encouraging look. ”And what happened then, Mr Sandburg?”
“I heard Jim shout ‘let go of the child!’” Blair said.
The above also illustrates an accepted convention where there are two or more speakers; in brief, give each speaker their own paragraph.
What if you have a wordy speaker whose speech should ideally be broken up into paragraphs? If there’s a lengthy speech, don’t close your quotation marks until the end of it. Also, the Chicago Manual of Style suggests that each new paragraph should have quotation marks at the beginning:
Don Haas stared sternly into the camera. “My investigations have raised troubling questions as to the ethics and performance of Cascade Police Department staff, and this in-depth report offers no easy answers. We can only make you, the viewer, aware of these issues.
“First, there is the question of why an acknowledged fraud, Blair Sandburg, was put on a fast-track to a privileged position in the division of Major Crimes-”
Jim turned the tv off.
This quote also illustrates using a dash to show that a speaker has been interrupted. If a speaker is trailing off in thought or uncertainty, then ellipses are the way to show that:
”Oh my God... ,” Blair murmured, staring at the vandalised living room.
It came as a surprise to me to learn that there are differences between US and UK usage. To quote this site, About.Com:
In the U.S., periods and commas always go inside the quotation marks. In the U.K., periods and commas go inside the quotation marks only for a complete quoted sentence; otherwise, they go outside. In all varieties of English, semicolons and colons go outside the quotation marks.
I've never met this before, I must admit. To add to this New Zealand reader’s confusion, the US and UK can operate under different conventions with quotation marks. Books printed in the UK have single quotation marks to open and close dialogue, with double quotation marks used to denote speech that’s been reported.
Sticking with the accepted dialogue punctuation basics will ensure that your readers are paying attention to the intent of your characters' words, rather than getting confused by dodgy formatting. Happy punctuating!