We use quotation marks to enclose direct quotations—things other people (who may be published, real, historical, or imaginary) have said. In North America, we use double quotation marks to enclose quotations or speech:
"I know I'm doing a few things wrong," wrote the original poster.
Lady Winterspoon began her letter. "Dear Mr. Rumpole," she wrote. She stared at the paper. She sharpened her pen. "I hope this finds you well." In novels, heroines separated from their suitors always filled sheets of paper. She wondered how they did it.
"Of course," said Lady Winterspoon to herself, "In novels, the heroine herself is the creation of a gifted author. Of course she can write pages and pages."
We don't enclose indirect quotations—paraphrases often introduced by that—in quotation marks:
The original poster wrote that he knew he was doing a few things wrong.
Lady Winterspoon remarked to herself that the heroines of novels were often the creations of a gifted author, so it stood to reason that they would be able to fill pages, writing to their suitors.
Enclose all punctuation that belongs with the quoted material. If the quote ends with a period, comma, question mark, exclamation mark, or semi-colon, these marks go inside the quotes.
"Blast!" said Lord Vrul, "Does anyone have a spare battery?"
His subordinates shook their cephalod appendages, until the most junior member of his squad extended a pseudopod.
"Mine has a charge, your Worship," he said.
If the quotation begins mid-sentence, then you don't need to use a capital letter:
Mr. Rumpole had said that he would be gone "months, perhaps years, on a mission so secret" that he should not have even mentioned it to her.
The principle that the quotation marks enclose original the words and punctuation of the speaker or writer being quoted is pretty straightforward. Writers (like me) can get muddled when quotes are interrupted.
When the quoted sentence is interrupted, close the quotes around the interruption, but do not begin the second part with a capital letter:
"I know," continued Lady Winterspoon, "that you will not receive this letter for weeks, or perhaps even months, but I hope that, having received it, you will know that I hold you in my thoughts and heart." She stopped, again. She certainly hoped she would hold Mr. Rumpole faithfully in her heart, but she did not know when she would next see him. Much might happen in a young lady's year, especially when that year would bring her first London Season.
For quoted material inside a quotation, use single quotation marks (inverted commas) to set of the interior quoted material:
Mr. Rumpole folded the missive, regretfully. "She writes 'I will hold you in my thoughts and heart' but how can she know her heart," he mused, musingly.
I find that if I remember that quoted material interrupts a sentence, and may complete it, I can avoid most of the perils of mispunctuation.