Both are correct, but they have slight differences in nuance:
1. "It's time for them to have fun." - Suggests that summer vacation is the specific period when children can have fun.
2. "It's a time for them to have fun." - Suggests that summer vacation is one of the periods when children can have fun, implying there could be other times too.
Both are natural and depend on the context you want to convey!