The latch bolt is the part of the lock with a sloping side that is pushed out by a spring and goes into the strike plate by itself when the door is closed. It draws back when you press the handle or turn the knob, and on many locks when you turn the key as well.
It is what lets you pull the door shut without a key. Because of its sloping face it gives way if pushed from the edge, which is why a door held only by the latch can be opened without breaking anything. Some locks have an anti-card latch, which locks in place when the door is shut.
If the door does not stay shut when you push it to, the latch is usually not reaching the strike plate or its spring is worn. It is put right by adjusting. More under lock installation and lock repair.