What's the difference between latch and lock?

Solution 1:

A latch fastens a door, gate or window in position but does not provide security. (See Wikipedia.)

A lock prevents anyone without a key from opening a door/gate/etc.

Solution 2:

A latch keeps something closed but does not lock it.

Solution 3:

A latch is a very simple device that keeps a door or window closed. On a door, it is simply a sliding piece of metal or wood that slips into a slot, or even a piece of rope with a loop that can go over a small post.

A lock needs a separate device (a key) that will unlock the lock.