What's the difference between “que” and “dont”; for example in:
Je lis le livre que tu m'as donné. (I'm reading the book you gave me)
Je lis le livre dont tu m'as parlé. (I'm reading the book you told me about)
As a side note to the answer given by Laurent, even a French native speaker sometimes needs to think about the inverse sentence "Tu m'as donné un livre" to deduce the correct insertion of "que" w.r.t "dont".
In the second sentence "Tu m'as parlé d'un livre", mind the "d'" (or "de" depending on the case), that will lead you to the insertion of "dont".
Not sure it's helpful, though. (That's my first answer here.)
Here as in all relative clauses it's a case problem (yes there are cases in french). Both dont and que (as duquel, auquel, etc) replace the noun in the relative clause :
Dont is the genitive form and it's used to mark a complément du nom
Que is the accusative form and marks a complément d'objet direct, a direct objet of the relative clause. "Que" is also an ambivalent word equivalent to the English "that" or even "what" as in "je sais que j'ai raison" (i know that i'm right) or in "les mots que j'ai dits" (the words that i said) (and i'm not sure about that s after dits)
Auquel would be the equivalent for an indirect object.