Gear 4 is not a single form but a technique with multiple applications, each debuting at different points in the series:

Luffy first unveiled Gear 4 during the climax of the to combat the overwhelming power of Donquixote Doflamingo.

In summary, It is a desperate, last-resort power born from two years of intense training, and it forever changes the stakes of Luffy’s battles.