On macOS, you can use a third-party app blocker like Cisdem AppCrypt. It has both Mac and iOS versions, but the Mac version offers more control.
For example, if you want to block App A from 9 AM to 10 AM and App B from 4 PM to 5 PM, its Custom Schedule feature lets you set different schedules for different apps or websites.
On iPhone/iPad, the built-in Screen Time feature is a simple option. You can go to Settings > Screen Time > App Limits and set time limits for apps.
One thing to keep in mind is that Screen Time may be easier for kids to bypass if they find ways around the restrictions. For stronger control, a dedicated app blocker may be a better choice.