Other than taking them back and buying something different, there isn't much you can do to those if they don't have some type of internal timer function.
Why not put a simple motion sensor light fixture in the garage? They only come on when it's dark, and you can set the amount of time the light stays on after motion is no longer detected from 1 minute up to 4 hours or more, depending on the light fixture you buy.
I had the screw in motion sensors you put into a simple light fixture in my garage for the same reason you wanted, but none of them ever lasted more than about two years. And they were expensive.
So I bought a cheap $12.00 motion sensor light fixture at Home Depot, removed the motion sensor part, and wired that up to a single bulb light fixture in the garage. I set the timer to shut the light off after 1 minute of no motion, and it works great.
Here is the one I bought and removed the motion sensor from. Where it is mounted in my garage it can see both "people" doors, so no matter which door you come in, it will turn on the light so you can see.
Jim