Edit : A timed lock for the medieval era.
You might not think timed locks are very likely or easy to come by in a medieval setting.
But, then again, perhaps not.
First find yourself a cave.
Then you need a big rock (too heavy to move unaided & big enough to block the cave).
Now you'll need some rope some wooden pit props a source of water & something to sling your rope over, this all needs to be outside the cave.
Sling the rope over your 'something to sling a rope over' & tie the rock to one end & the bucket to the other such that your bucket is hanging in the air over your head, fill the bucket with water so that you can now lift & move the rock, place it over the cave entrance & wedge the pit props under it to keep it there when you empty the bucket, you know have to arrange for water from a nearby water source to drip into the bucket (you're going to need some piping).
Enter the cave kick out the props (or tie ropes to them & pull them away) & the rock slams down locking you in until the bucket has filled enough to let you move the rock.
Some experimentation with bucket size, drip speed & what have you may be required to get the desired timing
After the tragic early cave opening & subsequent village slaughter the first time it rains they'll realise of course that they have to cover the bucket so only the intended drips get in.
Voila! & there you have it, one crude water clock locking mechanism.
If your werewolves have access to craftsmen or else have the necessary skills themselves the same principles can be applied to something a bit more sophisticated in a normal cellar or they might use a clockwork timer & locking mechanism you set on the outside of the door.