If you have ever stood in the produce aisle wondering about sweet potato vs yam, here is the surprise: in most U.S. supermarkets, the orange “yams” are sweet potatoes. True yams are a different vegetable from a different plant family. Here is how the two differ, why the names got mixed up and what to buy for your recipe, based on the Library of Congress and university Extension sources.
The short answer: sweet potatoes and true yams are different vegetables from different plant families. Sweet potatoes usually have thin, smooth skin, while common market yams often have rough, scaly skin and starchier, drier flesh. In U.S. supermarkets, orange “yams” are usually sweet potatoes. For American holiday dishes such as candied yams, buy orange-fleshed sweet potatoes. For a recipe that specifies true yams, buy the yam variety it names.
Sweet potato vs yam: the key differences

Sweet potato
True yam

Plant
Ipomoea batatas, in the morning glory family. The edible part is a storage root.
Dioscorea species, in the family Dioscoreaceae. The edible part is an underground tuber.

Origin
Central and South America
Varies by species; major cultivated yams come from Africa and Asia

Typical skin
Thin and smooth; white, yellow, red, purple or brown
Tough and scaly, and hard to remove

Flesh
White, yellow, orange, orange-red or purple, depending on variety
White to yellow, purple or pink, depending on species

Cooked texture
Soft types become moist and sweet; firm types stay drier and crumbly
Generally starchier and drier than common U.S. sweet potatoes

On U.S. labels
Soft orange types are often sold as “yams,” which must also say “sweet potato”
Less common in mainstream supermarkets; more often at specialty and international markets

Appearance and texture vary by variety and species, so treat these as common traits, not universal rules. Details are from University of Illinois Extension’s sweet potato and yam explainer and Mississippi State University Extension’s sweet potatoes vs. yams article.
They belong to different plant families
The Library of Congress’s Science Reference Section says yams and sweet potatoes are both flowering plants but are not related botanically. Its Everyday Mysteries answer describes yams as monocots in the yam family and sweet potatoes as dicots in the morning glory family. Illinois Extension adds that sweet potatoes are not related to regular potatoes either. A true yam is not a sweeter or starchier sweet potato. It is a different vegetable.
How they look and cook
A sweet potato has thin, smooth skin, while Mississippi State describes a yam’s skin as rough and scaly. Illinois Extension says a yam’s tuber is covered in tough, scaly skin that is difficult to remove, can range from potato-sized to several feet long, and is starchier and drier than the sweet potatoes most commonly grown in the U.S. It says yams are often boiled and mashed, fried, roasted or baked. Smooth, thin skin and tapered ends are 

Author