The Time Input Widget calls that function once, after you set the desired times and press OK.
From that time on, the sketch works with that pre-supplied data and reacts at the proper times, repeatedly… or until you change the settings and press OK again, then the function gets called again and works with the updated info.
Here is a good topic all about how that works… with a few examples.