I found I wrote a lot of dialogue at first because that part of the story is in one's head already existing in verbal descriptors. I had to work at learning how to describe the settings and other elements of the story because those were in my head as images.
I had the same problem, plus not realising that other people wouldn't get the same images in their head automatically from reading the dialogue (I started creative writing as a hobby when I was 12 so there were a lot of things I didn't realise).
Back to the OP: what you need to avoid is the whole "talking heads" thing, i.e. the impression that disembodied characters (or disembodied heads or voices) are speaking in a blank room. You need enough other info for the conversations to be real.
You also need to avoid the temptation to write everything that characters say. That's another thing I used to do. I'd see entire conversations playing in my head between my characters as they interacted with each other and thought I was supposed to write the entire conversation down, small talk and random stuff and everything. (This goes hand in hand with way too much stage direction.) These days I realise that you only need to include the important bits, and some conversations are better rendered as indirect speech. For example:
I walked into the office and Tracey was standing by the tea machine.
"Alright Tracey? How's it going?"
"Not too bad... I'm a bit behind my target though."
"Yeah and me. Hope I'll catch up this afternoon."
"Did you hear, Jackie's leaving. She got a job at Tesco's. Payroll department."
"Oh my God! I can't believe that! She was so into this job!"
"Yeah I know!"
"Anyway, gotta dash, my break's over in one minute"
"Okay, see you around!"
Can all be replaced by: I bumped into Tracey by the tea machine and she told me Jackie was leaving. New job in Tesco's payroll department, apparently. Jackie! I can't believe it. I thought she loved this job.
i.e. focusing on what's important rather than feeling the need to relay every single thing that the characters are saying as the story plays out in your head.
The above is not an exhaustive list of potential pitfalls, but overall I'd say if you're getting feedback from others that there's too much dialogue (or if you feel that way when you're reading and editing your work), then it's likely that you have a lot of dialogue isn't doing anything useful, rather than it being about the actual amount of dialogue. (Or there's nothing wrong at all but you've been told some arbitary percentage that may be irrelevant to the type of story you're writing.)
As long as the all the dialogue is doing something useful (moving the plot forward, worldbuilding, character development etc) and there's enough non-dialogue there for all of what's going on to be clear, then there isn't really such a thing as too much dialogue. Some types of story will naturally have a lot more dialogue than others, i.e. stories where the action will take place through people speaking (courtroom dramas spring to mind).