During Elizabethan times , husbands were allowed to beat their
wives with a stick, but there were restrictions and guidelines.
They could not hit their wives after 10PM, nor could they use a stick that was wider than a thumb. This was called "The Rule of Thumb."

It later came to be used generally as meaning a guideline for any activity.