Locks create an extra line of defense in protecting valuables from raiders. Up to five items can be placed under a lock, and only one item can be taken per day. In addition gold can be placed under the lock, which does not count towards the item limit; gold will be prioritized over items, "protecting" them, and only 2 gold can be taken per day.
So for example if you set a lock on 10 gold and five items, it will take five days to loot all the gold, and five more days to loot all the items.
Locks can only be used by the player who made them, or by other members of their tribe if the lock was made after the player joined the tribe. Because of this it is generally prudent to not obtain locks from others, as you will be able to set them, but in most cases not open them again. A scholar's lens will also not display the crafter of a set lock.
Instead, a scholar's lens will display either the name of the player who set the lock, or of the last player who looted it.