What would you call a person who thinks they know everything and decides to share every little fact they can think of? For example, if a teacher or professor says something and a student decides to say "oh, interusting fact about this" or "one time, something happened relevant to something you just mentioned", but then they go off topic and say non relevant stories and the whole classroom falls asleep. Or is there not a word for this?
The person can be said to suffer from verbal diarrhea
The fact or habit of talking too much: was it necessary to have the narrator exhibit verbal diarrhea throughout the entire picture? [Oxford Dictionaries Online]
excessive, uncontrollable, or incoherent talkativeness [Collins]
And, by extension, they might be called a logorrheic.
More simply, they might be called a blatherer. Oxford defines blather as
Talk long-windedly without making very much sense: she began blathering on about spirituality and life after death
If the person usually ends up off topic, and you want to express that point, I'd consider using digressive (although it seems to be more commonly used to describe conversations/text rather than people); as Collins has it:
digressing or given to digression
As Hellion notes below, serial digressor, or perhaps just digressor, would work if you're looking for a noun instead of an adjective.
Otherwise, garrulous might be a better fit.
talking much or too much, esp. about unimportant things; loquacious
Hard to think of a good noun option. Blabbermouth. Motormouth. Windbag. They all sound somewhat dated. Although I do like windbag.
Adjectives that might help: "prattling," "filterless," and "windy."
Or you could get metaphorical. In college, who we nicknamed a kid who did that "Filibuster" -- it stuck.
Answers you have so far address the constant talkativeness, but there is one aspect related to your question which has not been addressed, and that's the concept that the talkativeness is triggered by always having a story or embellishment to other people's situations/dialogue. This is known as 'one-upmanship' (Mirriam Websters definition).
One-upmanship is a competitive desire to always have something to add that is just that next step better than what other people have, say, or do. People who try to one-up others often interject with a 'better' story, or a 'more interesting' fact.
Sort of like this answer, actually.
If the intention of one persons continuous, unending - and not unusually - monotone speech was to to hog the conversation, and not notice or recognise the drooping eyelids and possibly tunnel like yawns of others in the vicinity - maybe even a collections of zzzZZZs too, then the title 'smart arse' or 'creep' may be applied.
If his boss is present then another term should be applied...... But he'd probably be too pompous, uncaring and stupid to realise.
Does that remind you of someone you've ever had to work with?!