A variety whose seeds have been saved for generations.
An heirloom tomato is an open-pollinated variety that's been grown and passed down for many years, often decades, by families, communities or seed savers. Open-pollinated means the seeds produce plants just like the parent, so you can save seeds from this year's best tomatoes and grow the same variety next year.
There's no single legal definition. Many growers use 50 years as a rule of thumb, while others count any variety kept going by home gardeners rather than bred for commercial farms.
Hybrids are different. They're crosses of two parent varieties, often bred for disease resistance, yield, uniform shape and the ability to ship well. Seeds from a hybrid won't reliably grow the same tomato.
Heirlooms are loved for flavor and variety: Brandywine, Cherokee Purple, Green Zebra and Mortgage Lifter come in many colors and odd shapes. The tradeoff is that they're often softer, crack more easily and don't travel well, so they're best from farmers markets or the garden.