Naturally, this is not a hard and fast rule (nothing in writing ever is), but it is a good thing to keep in mind. Dialogue needs to read right, sound right.
If you think about how people communicate, you'll realize that people are never direct, transparent or able to immediately state what's on their mind (if you are a devotee of semiotics, you know its because of the gap between signifier and signified). Language is not precise. People are not precise. There is much coloration, hesistation, interpretation and misinterpretation, assumptions, translations.
Even a seemingly obvious statement like this...
ME: I'm hungry.
...does not reveal to the person spoken to the exact nature of my hunger (food? sex? company? excitement?). Even with the context clues (body language, vocal tone, accent, expression, gesture, distance, props, time of day or night, location) the listener can only make the best assumption as to what I'm talking about. If you and I are both in the restaurant, you'd seemingly be justified in assuming I'm talking about food.
But what if I'm not not? What if what I meant was that I'm hungry for you? Language fails because of its inherent flaw: it translates thought - but only to best of its limitations.
So when I read something that continuously has characters directly stating things (without anyone doubting the precise meaning, or without clarification, repetition, misunderstanding), it reads wrong. Because I know that in life, which almost every bit of literature tries to emulate (otherwise, what's the point of having people talk in your work - unless you do not care about characterization), it is not the case.
Listen to how people speak. You'll notice some of the following - some of which can be used in writing, as the realists do:
Sometimes, they do not complete sentences. Because sometimes-
-people interrupt each other.
Everyone involved in a discussion has an agenda (haven't you experienced trying to shift the conversation back to what you want to talk about?).
Exposition is rare (which is why, as a literary tool, exposition must be used with great skill and sensitivity - believe me, nothing threatens to bore a reader more than this).
People tell anecdotes. Because, whether they believe it or not, we are all storytellers to a degree.
People reference a lot ("did you see that movie where the...?", "so anyway, Vin told me that Andrew said that he...", "I read this article that said..."). Very rarely does anyone simply state a (questionable) fact and get away without even a little explanation or justification.
Conversations are fluid. That makes them interesting (and quite challenging to create from whole cloth).
Some people just listen. Others need to participate verbally in conversation. In other words, not everyone has something to say or contribute - but this in no way excludes them as participants.
Some topics have the half-life of a split second (someone brings up a topic, none or few respond, then the conversation moves on without a batting an eyelash).
These last three are linked: People repeat themselves ("I told him, I said to him...").
People question each other ("really?" or "talaga?" or "who said that?"
Some people parrot the last question (D: "Okay, what's your favorite color?" V: "My favorite color?" D:"Yeah, what's your favorite color?"
Of course, there are lots more to observe and add to your arsenal as an author (this list is by no means exhaustive or even necessary - it depends on your writerly goals, style, voice). With fiction, you can get away without dialogue. But when you write that particular story where people talk to each - and you will eventually write that story - you need to keep the notion of what makes dialogue work in mind. Remember that everything you create is immediately artificial by virtue of the act of contrivance. The last thing you want is to detract further from your reader's suspension of disbelief.