A lock is the mechanism that keeps a door shut and only opens with its key or, from the inside, with the knob or handle. Inside there is a case holding the bolt, the latch and the parts that move them; depending on the model, the key works either a lock cylinder or a set of levers.
Locks are told apart mainly by how they are fitted: mortice locks, set into the edge of the door, or rim locks, screwed onto the inside face. They also differ in the number of locking points, either a single one or multipoint.
If a lock starts to feel stiff, do not force it with the key: it is almost always dirt or poor adjustment, and it can be put right before something breaks. If you want a new one fitted or the one you have improved, have a look at lock installation.