Cannot animate viewport/render visibility
You can animate the "Show in Render" and "Show in Viewports" flags here:


For entire collection, you can link the Animation Data from one object to the others. Note that this will override other keyframes set on destination objects.