A tangent is an entirely different topic or direction. When you want a break from geometry class, you might ask your teacher about his hobby of woodworking, a topic that's always good for a ten-minute tangent.
Tangent is mainly a mathematical term, meaning a line or plane that touches a curved surface but doesn't intersect it. The non-mathematical meaning of tangent comes from this sense of barely touching something: when a conversation heads off on a tangent, it's hard to see how or why it came up. When talking about history, someone suddenly brings last night's basketball game? Definitely a tangent.