An oarlock is a device that attaches an oar to the side of a rowboat. Most oarlocks are built into the sides of the boat, and they make rowing much easier.
You're less likely to lose an oar if your boat has oarlocks, and they also provide a base or fulcrum for the oars. On a racing boat, the oarlocks are especially designed for ease of moving the oar, while the oarlocks on your old metal dinghy are likely to be simpler. In either case, they can be made of metal, wood, or plastic, and are called "rowlocks" or "spurs" in the UK and "gates" in Australia.