I'm not an expert, but to my knowledge, an en dash is used to determine things like range and relation (2011--2012; father--son relationship), whereas an em dash is used as a break in a sentence (He nudged the ball with his foot---that is, he kicked it with all his might---right into the old hag's yard.). I think em dashes are pretty similar to parentheses, depending on the context. Again, I'm no expert when it comes to this sort of thing. I rely probably too much on auto-correct and the little green error squigglies when I write. :/
An en-dash is denoted by a single hyphen in manuscript. An em-dash is denoted by two hyphens. The em-dash is most widely used as one of the three choices for delimiting a parenthetical phrase in a sentence. The other two delimiters are commas and parentheses.
Is this the same in novels where authors would put a long dash (looks like -- but in one single line) in a sentence involving dialogue?
Yes. An em-dash is a dash nominally as wide as a letter m, and denoted in manuscript by two hyphens. An en-dash, far less common, is a dash nominally as wide as a letter n. The en-dash and the hyphen are both represented in manuscript by a single hyphen, so conversion to an en-dash is generally a typesetter's choice rather than a writer's choice. The dash used in a number range is an en-dash.
ditto cog's posts... there is no such thing as a triple em dash that i know of... the double hyphen is used only to indicate an em dash and an en dash is only used singly, but not in normal writing, to my knowledge, since the hyphen is usable for anything an actual en dash would be appropriate for...
It's worth noting that Cog is referring to US usage. In the UK we'd usually use an en-dash with spaces around it rather than an em-dash without spaces for setting off parenthetic phrases. And that online you'll often see double hyphens and triple hyphens for en dashes and em-dashes respectively because a lot of online conventions were devised by geeks who use markup languages such as TeX and laTeX which use just that convention. It's become so common that Word has autocorrect-as-you-type substitutions for them enabled by default. That's fine online and when using those markup languages, but in manuscripts you should follow the manuscript conventions.