Dreaming of an affair shows we are seeking to integrate opposite polarities within ourselves:male / female, drive / receptivity, good / bad. Such integration and an understanding of the dynamics leads to wholeness and an ability to access hidden aspects of our personality.
Psychological / Emotional Perspective:
We could be actively seeking emotional satisfaction in a way that is unacceptable in our waking lives. In dreams, to be having an affair with someone we don’t know suggests that we should perhaps reassess our own needs and desires. If the affair is with someone we know but would not normally consider in that light we are perhaps looking for different sorts of satisfaction.
Everyday Material Aspects:
We need to come to terms with our own sexual needs and desires for excitement and stimulation. Dreaming of an affair allows us to release such feelings. We may feel the need to do something naughty or something that means we have to take emotional risks.
Gender / Specific Meanings:
When a woman dreams of an affair, it is likely that she has registered that connection before becoming consciously aware of it. A man will tend to be more physically attracted before dreaming of an affair. Men tend to be better at analyzing systems while women tend to be better at reading the emotions of other people. They have an increased ability to bond and be connected to others.
For further clarification you might like to read the entries for Family and People.