2) to indicate possession (in some cases), and
3) VERY occasionally to denote a plural (where otherwise the meaning of the sentence would be unclear).
The use of an apostrophe in the contraction "it's", (which means "it is"), but not in "its", (which is a possessive) causes problems for many people who didn't pass third grade.
Incorrect: Its raining cat's and dog's.
Incorrect: Here come's the train. Grab it's cargo.
Correct: Don't go in that room.
Correct: The cat's litter box is dirty.
Correct: Mind your p's and q's.
(the above is one of the ONLY CORRECT USES OF AN APOSTROPHE TO DENOTE A PLURAL. FOR THE LOVE OF GOD IF YOU'RE UNSURE, JUST LEAVE THE APOSTROPHE OUT.)