Your shows that something belongs to you, as in your bag. You're is a contraction of you are, as in you're late. If you can put "you are" in place of the word and the sentence still makes sense, write you're; if not, write your.
Mixing up your and you're is one of the most common mistakes in writing. The two words sound the same, so it is easy to type one when you mean the other. The good news is that once you know the difference, you will rarely mix them up again.
Other words that sound alike but are spelled differently are the trio there, their, and they're and the pair its and it's.
Your: something that belongs to you
Your is the second person possessive adjective (also called a possessive determiner). It shows that something belongs to you or is connected with you. It always comes before the thing it describes: a noun, a gerund, or a noun with an adjective in between.
- Your bat is excellent for hitting.
- I like your new haircut.
- Thanks for your help.
- Your singing woke the neighbors. (Here singing is a gerund.)
You're: short for you are
You're is a contraction of you are. The apostrophe stands for the missing letter "a". It has no other use, which makes it the easier of the two to get right.
- You're such a liar. (You are such a liar.)
- You're the best friend anyone can have. (You are the best friend anyone can have.)
A simple test: say "you are"
Sounding the word out does not help much here, because your and you're usually sound the same. Instead, read the sentence with "you are" in place of the word. If it still makes sense, write you're. If it does not, write your.
Take Your bat is excellent for hitting. With "you are", it becomes "You are bat is excellent for hitting", which makes no sense. The bat belongs to you, so your is right. You're the best friend anyone can have becomes "You are the best friend anyone can have", which makes sense, so you're is right.
Unsure about other words that are often mixed up? Read commonly misused words and how to use them correctly.
Other rules to keep in mind
In formal writing, such as a report, a job application, or an academic paper, many style guides advise against contractions. There, write is not, cannot, do not, it is, and you are instead of isn't, can't, don't, it's, and you're. A text without contractions sounds more formal, and it has a useful side effect: if you never write it's or you're, you cannot confuse them with its and your.
One more tip: the possessive pronouns that stand on their own, such as yours, ours, his, hers, and theirs, never take an apostrophe. Write The book is yours, never your's. Understanding possessive adjectives and pronouns explains the difference between your and yours.
Once you know the your and you're rule, you are well on your way to getting both words right every time. Both are real words, so a check against a dictionary alone does not notice when you use the wrong one. The AI Spell Checker reads whole sentences, so it also catches a real word in the wrong place.