Guideline is here: https://xkcd.com/1205/
The chart assumes a task is done at the specified frequency for 5 years. It’s a good guideline, though not perfect. For me personally, if I can eliminate a task that I need to do 50 times a day, I would be willing to spend more than 1 day on the automation even if the task takes only 1 second. However, if the task takes 2 seconds, and I save only 1 second from the automation (i.e., I still have to do it 50 times a day), then I would follow the suggested guideline.