There are a few occasions when an apostrophe is needed.
1) Single quotes. Not strictly 'apostrophes', I've included them because you at least have to press the apostrophe key on your keyboard. There are two types of quote mark - the single quote (which uses the apostrophe key) and the double quote (which is SHIFT 2 on the keyboard).
In prose, one set of quote marks is used to denote speech. Usually it's the double, but single quotes can also be used. It depends upon the author and publisher. I prefer to use double quotes for speech, as I find single quotes can sometimes look messy when combined with other apostrophes in the sentence.
Double quotes - "I need to go to the doctor's," I said.
Single quotes - 'I need to go to the doctor's,' I said.
Both are acceptable.
The other set of quote marks are used for highlighting an important word, like 'apostrophes' in the sentence Not strictly 'apostrophes', I've included... or for quoting words from a passage of text or speech. If you use double quotes for speech, use single quotes for highlighting and quoting, and vice-versa.
e.g. 1 "Do you know what she said?" I asked. "She said, 'Why don't you just leave?', and so I did."
'Do you know what she said?' I asked. 'She said, "Why don't you just leave?", and so I did.'
e.g. 2 Mark Twain once said that golf was 'a good walk spoilt'.
Mark Twain once said that golf was "a good walk spoilt".
So, make a choice! Direct speech using one type of quote mark, highlighting and quoting using the other. But as I said, I prefer double quotes for speech.
2) Contractions and missed-out letters. What is a contraction? It is making something smaller. In writing, a contraction is when two words are squashed together to make one word.
Did not becomes didn't.
Have not becomes haven't.
Would not becomes wouldn't.
Could have becomes could've
The rule is simple. The two words are squashed together. A letter is omitted (usually the 'o' from not). An apostrophe is used in place of the missed-out letter.
In the contractions could have / would have / should have (remember, it is NOT would of or should of!) the words get squashed together and we omit the first two letters of 'have' and put in an apostrophe.
And then there is one of my pet peeves: the misuse of your and you're! Your means something belonging to you. You're is the contraction of you are. See the apostrophe? It means there's a letter missing, and that two words have been contracted - make sure you learn the difference!
You may wonder if you can contract the three-word 'would not have' into the mega contraction wouldn't've. The answer is... no! Wouldn't've is not a word. Use wouldn't have.
Also, use an apostrophe if you have missed off a letter in slang. People commonly miss off the g sound in ing -
"That is frickin' brilliant!"
3) Possession. This is the trickiest rule to grasp. You use an apostrophe to show that something belongs to something else. Whenever you are wondering whether to use an apostrophe or not, phrase the sentence thus:
The such-and-such belonging to such-and-such.
The pen belonging to the girl.
The car belonging to Harry.
Now, the pen belonging to the girl means that it's the girl's pen. And it's also Harry's car. You add an apostrophe s (which looks like this: 's) to the end of the owner. BUT! Only if the owner is singular. That is, if there is only one girl, and only one Harry.
These are singular possessives.
One girl, one pen? The girl's pen.
One girl, many pens? The girl's pens.
But what if the singular word ends in s? Like something belonging to Chris, or belonging to the bus?
There is some conflict between styles, unfortunately. Most style guides say you should still add apostrophe s ('s), just like any other singular possession. Chris's hat. The bus's wheels. This is what I much prefer and would recommend.
Some of the more modern style guides say you need only use an apostrophe. Chris' hat. The bus' wheels. I sigh at that.
The most important thing is to pick a style and stick to it.
You also have plural possessives.
It sounds complicated, but isn't really. Plural just means more than one. Again, we are talking about the owner. Is there more than one girl, and they've thrown all their pens into a pile?
Again, phrase the sentence thus:
The pens belonging to the girls.
Notice that girls is now plural, because there is more than one girl. You do NOT add apostrophe s. You just add the apostrophe: The girls' pens.
The toys belonging to the boys? The boys' toys. (plural)
But if one boy has lots of toys? The boy's toys. (singular)
Look at what comes before the apostrophe. boys' = boys (lots of boys). Boy's = boy (one boy).
Most plural words end in s, and you follow this rule. But what happens if a plural does not end in s? Like children, or men. Then you add apostrophe s ('s) again!
The classroom belonging to the children - the children's classroom.
The beer belonging to the men - the men's beer.
It is NOT childrens' classroom, or mens' beer. Again, look at what comes before the apostrophe. Childrens is not a word, and neither is mens. The pural is children, and so you use apostrophe s.
To be a little technical, possessive apostrophes are only used for nouns, not pronouns. Here are some possessive pronouns: my, mine, your, yours, his, her, hers, its.
You do NOT use apostrophes for these possessive pronouns. The most confusing ones are the ones ending in s. Yours, hers and its. You do not write that pen is your's or that is her's. You write that pen is yours and that is hers.
Its is the most confusing, because there is a word it's, but this is a contraction of it is!
So only write it's if you mean it is.
It's raining outside.
Its wheels fell off. (You do not need an apostrophe for a possessive pronoun!)
When not to use apostrophes. Commonly, people will mistakenly use apostrophes to make plurals out of numbers and letters. You do not need an apostrophe in this sentence:
Can all the number 7's stand up? Now all the B's.
It should be
Can all the number 7s stand up? Now all the Bs.