(1) denn
This word is a conjunction and often means "because", e.g.:
"Ich gehe jetzt nach Hause, denn es ist schon spät." (I'm going home, because it's late.)
But it is also used as a modal particle to express emotion, such as curiosity or an unpleasant surprise, e.g.:
"Wann fängt denn der Film an." (So when does the movie start?) OR "Was machst du denn hier?" (Well, well, what are you doing here?"). In this case it's really hard to translate, and we would have to put in words like "so" or "well, well" to achieve a simiilar emotion.
(2) dann
This word translates as "then" and can be used in various ways, e.g. to say first this, then that:
"Ich muss erst einkaufen, dann kann ich Abendessen kochen." (First, I have to go grocery shopping, then I can prepare dinner.)
But it also used to intensify a condition, e.g.:
"Wir können den Film erst dann anschauen, wenn er ins Kino kommt." (We can only watch the movie, when it's in the cinema.)
You might also see "dann" as a filler word simply meaning "well, ok, then", e.g.;
"Dann noch einen schönen Abend!" (Have a good evening!)
or as an exclamation, like in:
"Wenn das nicht funktioniert, was dann?" (If this doesn't work, what then?)