RAW, the spell ends after one minute
The guidance spell states:
You touch one willing creature. Once before the spell ends, the target can roll a d4 and add the number rolled to one ability check of its choice. It can roll the die before or after making the ability check. The spell then ends.
We can immediately see that if the spell is cast and a minute passes, the spell ends, any possible benefits are no longer available; the target must make an ability check before the minute is up.
We can also see that the roll is added to an ability check, but nowhere does it state that the spell must be on for the entire duration of the task; it only needs to be there exactly when the actual ability check is made.
Say some task causes ability checks each hour, you could meta-game by waiting to case this until 59 minutes had passed so the spell could help with the ability check.
Having the spell work would involve meta-gaming, but being especially concerned with something like this is probably a bad idea
Getting into such a level of detail already involves such an odd level of abstraction since the spell technically only applies if an ability check is made during its duration. It is the very meta constructs of the game that are resulting in this scenario - that the saving throw is made once an hour.
At the very least, nothing actually happens at the end of the hour; the task is constant and takes up that entire time so why would the very end be the only part that matters? I personally would allow the 1d4 to apply so long as the spell was cast at some point during the task simply because nothing special is actually happening at the very end which is the only time it would work by RAW.
Finally, the difference here is a single d4, that's an average of 2.5 being added to the ability check. This is not some large amount that will throw off your game, though it's certainly not insignificant either. This is another reason I feel allowing the 1d4 to apply even if it technically wouldn't is a perfectly fair thing to do.
One way you could implement this, suggested by user Ryan C. Thompson in a comment, is the following:
When the players declare that they want to do this, to narrate one of the critical steps in the activity and describe how the guidance helps during that step.