It depends on what you're trying to accomplish.
Think of authors that you've read who handle dialogue differently, and what they were trying to convey.
For instance:
"I'm headed to the store," Bob called out to his wife as he headed for the front door.
"Really? What are we out of?"
"Eggs. I used the rest of them baking that cake last night, and I wanted to make sure that we had enough for the church brunch this Sunday."
"Oh, okay. Drive safe, hurry back."
"I will. Love you!"
"Love you, too."
As opposed to:
Bob slowly trudged down the stairs. He longed for the days when something as simple as going to the grocery store was just that: simple.
He cleared his throat before calling out, "I'm headed to the store."
Jill wiped the tears from her eyes. His voice had come out of nowhere, cutting through the dense fog of depression that threatened to overwhelm her. She looked around to see if he had seen her crying, but no, his voice emanated from somewhere else inside the house.
Her words came tumbling out before she had time to judge what tone was necessary. "Really?" she asked. "What are we out of?"
Bob was glad she was in the other room so that she didn't see his wince. "Eggs," he said, trying to keep emotion out of his voice. "I used the rest of them baking that cake last night, and I wanted to make sure that we had enough for the church brunch this Sunday."
Jill's face fell into her hands again. Like that cake was going to all at once make up for his betrayal. And that damn brunch! They'd agreed to help with the annual Memorial Day brunch over a month ago, long before his late-night confession.
She mustered the rest of her emotional strength to keep her voice in check. "Oh, okay," she said. "Drive safe, hurry back."
Bob almost let out an audible sigh of relief; one of the few discussions, if it could be called that, they'd had in a long time that hadn't devolved into a shouting match. "I will," he called out. He hesitated before saying what he had in mind next; he didn't want this spark to rekindle her anger, understandable and justified though it was. Nevertheless, he wanted his feelings to be known.
"I love you," he said, just before a tear snuck out and traversed a route down his cheek.
Jill heard the catch in her husband's voice, and a new wave of emotion rolled over her. He must think I hate him, she thought. How could I hate him? She felt the need to reaffirm their bond before he headed out the door, while at the same time not wanting him to think that everything was fine. She settled on a simple, "Love you, too."
Vs.:
Bob made sure to tell his wife where he was going before he headed out the door to buy more eggs for the Sunday brunch.
Even though the dialogue itself is the same in these three examples, they're each trying to accomplish something different, and neither is wrong. Any of these styles (or 17 others one could think of) could be applicable to the same story. Just establish what you're trying to accomplish before you try to accomplish it.