Air bar
Not to be confused with Air (Block).
The Air Bar or Breath Bar is an HUD that is only displayed when the player is under water. It starts full (10 bubbles), and slowly depletes. When the air bar is empty, you start to take drowning damage.
Enchantments
With the enchantment Respiration, you can stay underwater for a longer duration. The timings below show how long you can stay underwater. (The timer starts when the entity submerges into a water body and ends when the entity starts taking drowning damage (not the half heart damage)
No enchantments > about 14 sec
Respiration I > about 30 sec
Respiration II > 56 sec
Respiration III > about 1 min 24 sec
Drowning Damage
When the last air bubble depletes, you take half a heart of damage. After that, you take half a heart of drowning damage per second.