The switch by itself can’t be programmed at all. You need the smartthings hub to be the brains. But assuming that’s what you meant…
Sure, we’ve discussed this kind of thing in the past. There are multiple ways to do it.
At this point the most direct way would be to use core, although set up for that can be complex. But there are plenty of community members to help you.
Alternatively, you can use virtual timers and a daisychain, we had somebody with a pool pump who did exactly this. I’d have to find the thread for you but if you have any programming background I would look at core first. It will give you more options in the long run.