A latch (also known as a flip-flop or memory circuit) is a method by which a state can be held in circuit. The craftable latch in Starbound is a Gated D Latch.
When both the Top and Bottom input points of the Latch receive a signal, the Latch transmits a signal. When the Top input point receives a signal but the Bottom does not, the Latch stops transmitting signal.
This is handy when you want to be able to have something turn On and Off instead of having to continuously hold a plate down.
Switch A connects to both input points on the Latch. Switch B connects to only the top input point on the Latch. The Output point of the Latch connects to an Alarm. Pressing Switch A will turn on the Alarm. The Alarm will run continuously until you push Switch B.