Square means at 90 degrees to a reference: a square gate frame has corners of exactly 90 degrees and equal diagonals. The traditional check is a builder's square (a precision steel L) or by measuring the two diagonals of a rectangle: if both diagonals are the same length to the millimetre, the rectangle is square.
For gate fabrication, the frame is checked for square after tacking the corners and before laying full mitre welds. If diagonals don't match, the frame gets a tap with a hammer at the long-diagonal corner to bring it back into square. Once full welds are laid, the frame is locked in whatever shape it had at that moment.
Out-of-square gate frames don't sit right against the latch post, bind on the hinges, and rack visibly under their own weight after a few months.