Elizabeth-Anne's answer is the most correct.
I like (it) when I dream about my mother, and I know why she always smiles AT me every time I see her in A dream.
In this case, it is not correct to say "the dream," because you are talking about a series of events (dreaming about your mother), and implying that you always know why she smiles at you during the dreams. Since the sentence refers to dreams in general (albeit only those that are about your mother), you would use the indefinite article - "a dream," - because you may have dreamt about her any number of times, and you are not specifically referring to any one dream in particular.
The definite article - "the dream" - could be used in a construction like this:
"I dreamt about my mother last night, and she smiled at me in THE dream."
With regard to the use of the pronoun "it" (I like when vs. I like it when), both of these are very understandable. "I like when" is more grammatically correct; but, colloquially, in many places, native speakers will commonly use "I like it when" and "I like when" interchangeably. Many native speakers, at least in the United States, are totally unaware that "I like it when" is technically incorrect, and they would not know how to explain what is wrong about this clause. If you want to speak in the most correct way, then stick to "I like when" - but be sure that you will also understand "I like it when" whenever you hear this used by native speakers (which, in the United States, is basically every day).