A spirit level is a straight tool with a small tube of liquid and an air bubble in it. When the bubble sits dead centre between the two marks, whatever the level rests on is flat and level. Most levels have a second tube to check upright, called plumb.
On a gate job you use it to set a level line to measure from, to stand posts up straight, and to check the top of a gate is not running downhill. A 1200 mm box level is the common size; a small torpedo level fits in a pouch for quick checks.
For a long opening, pair a straight length of timber with a level, or step up to a laser level which throws a level line right across the site.