The mask causes Gibdos and ReDeads to recognize Link as one of their own, and so they will not attack him. While wearing the mask, Link can in fact talk to Gibdos, which is necessary to explore the Gibdo Well, which is, at first, the only way to enter the Ancient Castle of Ikana (and thus proceed in the game). ReDeads cannot be talked to, but the mask will cause them to dance, rendering them inoffensive.
The Gibdo Mask is one of six masks that are necessary to complete the game, the others being the three transformation masks, the Garo's Mask, and the Captain's Hat.
If, instead of wearing the aforementioned Garo's Mask, Link dons the Gibdo Mask, the Ghost Hunter will still grant him access to Ikana. However, Link must have already entered the cursed land at least once prior to this, in order to have obtained the mask.
↑"This mummy looks different... Sorta like it's here waiting for its human heart to be healed." — Tatl (Majora's Mask)
↑"You got the Gibdo Mask! This mask was once the hideous face of Pamela's father." — N/A (Majora's Mask)
↑"It seems the ReDeads that appear in Ikana Castle start dancing when the Captain's Hat, Gibdo Mask or Garo's Mask are worn. But that does not change things much..." — Gossip Stone (Majora's Mask)