The short answer
Tartrates are small crystals formed from salts of tartaric acid. This acid occurs naturally in every grape. The crystals settle at the bottom of the bottle or on the cork. A wine with tartrates is therefore not spoiled.

Why Crystals Form
Tartrates are tiny crystals that settle in the bottle. You'll find them at the bottom of the bottle or inside the closure. They come from the wine itself. No foreign object has gotten in, and they're not glass shards either.
The crystals don't say anything about quality. A wine with tartrates isn't better, and one without isn't worse. How a wine tastes and what condition the bottle is in—you'll learn that another way.
The cause lies in the grape. It contains tartaric acid, and part of that is present in the wine as a salt. These salts are dissolved, invisibly distributed in the liquid, similar to sugar in tea. But only a certain amount stays dissolved. Anything beyond that turns solid and sinks to the bottom. Cold intensifies this. That's why crystals often only become noticeable after some time in a cool cellar or the fridge.
The appearance depends on the wine. In pale wines, the grains look glassy to whitish. In dark wines, they've picked up pigment and look reddish or brownish. In your mouth, you might notice a slight crunch between your teeth at most. They don't change the taste at all, since the wine released the salts rather than absorbed them.
What you can do when pouring
Stand the bottle upright for a while before opening it. That way, whatever can settle collects at the bottom. Don't carry it across the room right before pouring, and don't shake it.
When pouring, a calm, steady motion helps. Don't set the bottle down partway through and then pick it back up. That way the sediment stays put. The last sip stays in the bottle if the little grains in your glass bother you. A small amount of tartrate doesn't require more effort than that.
On the cork, the crystals are even more harmless. They usually stick to the closure when you open the bottle, and you can just wipe them off. If you're unsure, light helps: hold the bottle against a bright surface. If the particles are lying still at the bottom, everything's fine. If something is floating freely in the liquid, though, take a closer look.
This explanation has its limits. Not every deposit is tartrate. If you see a damaged neck, actual glass shards, or a foreign object, don't drink the wine. Sort it out with the seller. A general explanation is no substitute for judging your specific bottle.

Crystals aren't a sign of bad wine
The most common misconception: that tartrate is a flaw you can get a refund for. It isn't. Crystals are simply something a wine does on its own. They say almost nothing about the condition of the bottle. The reverse assumption is just as wrong. Tartrate isn't a seal of quality craftsmanship or advanced age either. Neither can be read from a few little grains.
The second misconception is confusing tartrate with glass. Tartrate looks irregular, often a bit clumpy, and sits loosely at the bottom. Glass shards are something else entirely. This is exactly where you should stay alert: if in doubt, the general explanation doesn't count—only a look at your actual bottle does.
How to decide in everyday situations
Take the bottle in hand and look at the obvious things first. Is the neck intact? Does the closure sit cleanly? Is a piece missing from the rim? If everything checks out and you only see fine grains at the bottom or on the cork, drink the wine as usual.
If you find something else, this stops being a routine case. Keep the bottle closed and ask the seller. Take a photo of the neck and bottom beforehand. That saves you the trouble of describing it over the phone and makes the follow-up easier for both sides.