Carbon is naturally inclined to form new bonds, and in this quest, it may break away from the old ones. The atom or group of atoms that leaves the carbon chain to make way for the new bond is called the leaving group(s).
Such a bond dissociation can happen from a saturated, unsaturated, or carbonyl carbon.

The leaving group may leave before or after the new incoming group approaches for the bond formation reaction.
Two healthy scenarios occur about the departure of the leaving groups in organic chemistry-
Scene 1: The leaving group first leaves, and then the incoming groups come in to form the bond (seen in SN1-type reactions).
Scene 2: The entry of the incoming group and the exit of the leaving group may happen simultaneously (seen in SN2 type of reactions).

Either way, the leaving group doesn’t go empty-handed without any resources. It will leave with the shared covalent bonds’ electron pair through a process known as heterolytic bond cleavage.
There are minor exceptions, too. Few atoms leave behind their electrons and go away with nothing. These decisions depend on the nature of the leaving group.
Nature of the Leaving group
If the leaving group chooses to walk away with the bond electrons during heterolytic bond cleavage, it is called a nucleofuge. A nucleofuge can be negatively charged or neutral in nature.

In the above example, the chloride is displaced as Cl- by the hydroxide ion (OH-), forming a new bond with the carbon. In the second example, the hydroxide displaces a neutral molecule of water.
The nucleofuge can also be displaced from carbonyl-containing substrates.

However, if the leaving group leaves behind the bond electrons and goes without them, it is called an electrofuge. The most common atom that departs without any electrons is Hydrogen as H+.
The loss of Hydrogen as H+ is common in aromatic electrophilic substitution reactions, where incoming electrophile displaces another electrophile (H+) as a leaving group.
For example, in the nitration reaction of the benzene ring, the incoming electrophile is a NO2+ group, and the H+ is the leaving group.

However, apart from proton (H+), the cationic leaving groups are uncommon. The most common leaving groups are anionic in nature.
Presently, the term ‘electrofuge or nucleofuge’ is not so prevalent, and they are combinedly referred to as the ‘leaving group.’
The role of a leaving group is of the highest importance to the substrate to transform further by attaching various functional groups. The leaving group should enable a faster reaction and facilitate a smoother transition.
Author’s Note
Remember, when the incoming group is a nucleophile, the leaving group is always a nucleofuge.
When the incoming group is an electrophile, the leaving group is always an electrofuge.
Good and Bad leaving groups
A good leaving group is those atoms that take away the bond electron pair and do not share it with anyone else, basically hoarding it. The leaving group accommodates those extra electrons by offering them maximum stability. So, even though they are rich in electrons, a good leaving group does not act as an electron donor.
If G.N. Lewis defined bases as good electron donors, then the leaving groups try NOT TO be good Lewis bases. A good leaving group is, therefore, called a weak base.
On the other hand, bad leaving groups are those atoms that initially resist leaving the substrate and tend to hold on. Even when they are forced to leave with the two electrons of the bond, they try to readily partner up by transacting or donating their electrons, therefore acting as good Lewis bases. So, these bad leaving groups show less stability on being solo and subsequently also display high reactivity.
Some examples of good and bad leaving groups are-

In other words, the stability of the leaving group post-bond breakage becomes an important parameter to determine whether a group will act as a good or a bad leaving group. The greater the stability post the bond breakage, the better it will act as a good leaving group.
Next: Factors determining stability of the leaving groups - Electronegativity, Size, and Resonance
Next: Using pKa as a measure of leaving group ability
Next: Examples of reactions involving leaving group in organic chemistry
Related Reading
What are functional groups? Why are they important?
How does a covalent bond break?
Difference Between Electrofuge and Electrophile
Difference Between Nucleofuge and Nucleophile