If the location is a small enclosed space where the commanding officer (and perhaps one or two others) directly controls the vessel and all or at least a majority of vessel navigational, communication, and engine control functions without having to move from their position at the controls, it is a cockpit. Not just aircraft, but boats have them as well. If the location is a larger space where multiple people are expected to be on a routine basis to carry out operations, and the commanding officer does not (the majority of the time) directly control the vessel, it is a bridge.
There is, of course, a gray area. On modern automated bridges a single person can control almost everything from one console, but it's still generally called a bridge if you can get up and walk around without interfering with vessel control.
The benchmark I'd use is the "being able to walk around" part. To use Star Trek and Star Wars examples, in the cockpit of a Starfleet shuttle or the Millennium Falcon if you tried to stroll around, the pilot (who is typically also the vessel's officer in command) will get annoyed because you're physically getting in their way. On the bridge of a Star Destroyer or a starship, you can move around without interfering with anyone carrying out their duties, and the officer in command isn't the one in direct control of the ship (most of the time). Related to it is that on a bridge you typically must be able to move around to get to different controls because they aren't all accessible from a single position.
For example, if you look at luxury yachts, this would be a cockpit:

All the controls are at one station, and aside from whoever is at the wheel and the person beside them (considered to be a co-pilot), you can't get in there without physically getting in the way. There isn't any way for anyone else except the two people in the cockpit seats to be able to do anything.
This, on the other hand, is a bridge:

Lots of room to walk around and not interfere with operations, and the person at the wheel has to move around to control other basic functions such as the navigation and radar controls, which also means that while it could be controlled by a single person, it could also have several people able to carry out functions at the same time.