An “urban legend” is not the same thing as a “fictional tale” or an “apocryphal anecdote,” although many people mistakenly use the term in that sense (e.g., “That’s not true; it’s just an urban legend!”).
A tale is considered to be an urban legend if it circulates widely, is told and retold with differing details (or exists in multiple versions), and is said to be true. Whether or not the events described in the tale ever actually occurred is irrelevant to its classification as an urban legend.
For example, the tale about a student who mistakes a math problem thought to be unsolvable for a homework assignment and solves it is an urban legend, even though something very similar did once happen in real life. The tale is still an urban legend, however, because over the years many of its details (i.e., when it happened, where it happened, the identity of the student, the reaction of the student’s instructor) have changed as it has spread.