Generally speaking, apostrophes are used for two reasons: (1) to signal possession or (2) to acknowledge you've shortened a word by leaving letters out, which is called "contraction."
Apostrophes are used before an -s when a single noun possesses another noun (like "Sam's shoes"), after the s if the noun is a plural ("the three boys' shoes"), and anytime you contract words (like "wouldn't" and "she's").
Apostrophes are very small things, and the rules governing how to use them are simple. Still, many people are unsure about how to handle them, probably because they've generally fallen out of most informal writing, like text messages and social media posts.
People may also struggle with apostrophes because they're exclusive to written language, so we don't practice and internalize them when we speak, as we do other aspects of language. (You never actually pronounce an apostrophe, that is, unless the word already ends with an s -- like in Jess' phone or Jonas' birthday.)
For the same reason, getting them right is a strong signal of your technical control and comfort with written language, and using them properly will contribute substantially to the authority readers attribute to your work. It's a very small thing you can master pretty easily that will impress readers and lend significant credence to whatever it is you want to tell them.
Apostrophes are used to indicate possession and contraction.
Contractions, when you combine two words and leave a letter out, are especially simple: would not becomes wouldn't, do not becomes don't, it is becomes it's, etc.
Possession is a little more complicated, though only a little. Any noun can be made possessive by adding -'s. So the girl's books means that there's one girl who possesses the books. If there's more than one girl, however, the apostrophe goes after the -s: the girls' books means that more than one girl possesses the books. That is: girls' is both plural and possessive at the same time. (Of course, simple plural nouns don't take apostrophes at all -- like The three girls had a great time.)
The only exception to this rule is the possessive form of it, which takes no apostrophe. So we'd say That painting is very striking. Its colors are especially powerful. Here, without the apostrophe, its is possessive. But we'd say It's time for us to make dinner, meaning It is time.
So in a nutshell:
Plural -- girls
Singular possessive -- girl's
Plural possessive -- girls'
Contraction for it is -- it's
Possessive it -- its
Notice here, too, that a noun doesn't need to own another noun in a literal sense in order to be "possessive." The painting in the sentence we just discussed, for example, can't own its colors, though it does possess them.
Notice also that we often indicate possession with the preposition of. So we can say the car's size or the size of the car, Maureen's friend or friend of Maureen -- same thing. If we use the of, there's no need for an apostrophe.
You may well see this handled differently in different documents. Generally, you can either add an 's, as you would with any other possessive, or just add the apostrophe and nothing else. So both Socrates' most famous dialogue and Socrates's most famous dialogue are acceptable. Just be consistent. (If you're interested in how style guides disagree about this, see this discussion at The Editor's Manual.)
Determine whether or not each of these sentences is missing an apostrophe, and repair them if they do:
1. Football players jersey numbers reveal what positions they play.
Football players' jersey numbers reveal what positions they play.
Players' is plural and possessive -- apostrophe after the s.
2. Its no secret that its weight depends on the material you decide to use.
It's no secret that its weight depends on the material you decide to use.
The first it's is a contraction for it is, so it requires an apostrophe. The second its is possessive, so it shouldn't have an apostrophe.
3. Books titles are chosen more often by marketers than by authors.
Books' titles are chosen more often by marketers than by authors.
Books' is plural and possessive -- apostrophe after the s. Marketers and authors are simple plurals.
4. Most guitars strings are made of vinyl, but the best strings are steel.
Most guitars' strings are made of vinyl, but the best strings are steel.
Guitars' is plural and possessive -- apostrophe after the s. Strings is a simple plural each time it appears.
5. The companys reputation for fairness with employees is very bad – and its hiring practices are rumored to be no better.
The company's reputation for fairness with employees is very bad – and its hiring practices are rumored to be no better.
There's only one company, but it possesses the reputation, so apostrophe before the -s. Its is possessive, so no apostrophe.
6. No single cars brakes should ever be in danger of malfunctioning, though cars brakes can be unreliable if not serviced regularly.
No single car's brakes should ever be in danger of malfunctioning, though cars' brakes can be unreliable if not serviced regularly.
There is only one car in the first half of the sentence and it possesses the brakes, so an apostrophe after the r. Cars' is plural in the second half of the sentence, so an apostrophe after the s.
7. Surprise was written all over the girls faces.
Surprise was written all over the girls' faces.
Girls' is plural and possessive -- apostrophe after the s.
8. The faces of the girls showed their surprise.
The faces of the girls showed their surprise.
No apostrophes necessary. The girls possess the faces, of course, but possession here is indicated by the preposition of.
9. Most movies endings are predictable, but this screenplays author was unusually good at preserving suspense.
Most movies' endings are predictable, but this screenplay's author was unusually good at preserving suspense.
There's more than one movie, and they possess their endings, so apostrophe after the -s. The screenplay, which is singular, possesses its author, is so apostrophe before the -s.
10. Most books covers are very carefully designed, but this books publisher wanted to keep costs low, and its cover was pretty simple.
Most books' covers are very carefully designed, but this book's publisher wanted to keep costs low, and its cover was pretty simple.
There's more than one book in the first half of the sentence, and they possess their covers, so apostrophe after the -s. The book in the second half of the sentence, which is singular, possesses its publisher, is so apostrophe before the -s. Its is also possessive, so no apostrophe.