Any ideas what might be wrong?
Based on experience, the power supply is failing on the Time Capsule if you are not seeing other error messages in AirPort Utility. The supply will be OK for a few hours, but when it starts to overheat, it shuts down. After things cool down for a bit, the Time Capsule will operate OK for another few hours, then the cycle repeats itself over and over again.
IF.....you are seeing an overheating message though and the Time Capsule begins to blink amber, then the internal fan may be clogged with dust. Normally, you would hear the fan speed up when this occurs.
If the fan is not at fault, the solution is a new power supply for the Time Capsule.
http://www.ifixmaccomputers.com/apple-power-supply-replacement-apple-time-capsule-a1470
Unfortunately, repairs are not easy since Apple did not design the Time Capsule to be serviceable. If you decide to attempt this, be very careful when you take the Time Capsule apart as it is very easy to break a ribbon cable or connector in the process. The following article will provide some tips on the disassembly of the product.
AirPort Time Capsule A1470 (Mini!) Teardown - iFixithttps://www.ifixit.com › Teardown › AirPort+Time+Capsule+A1470+(Min...
IF.....the Time Capsule is 4-5 years old, repairs may not really be feasible at this point, since the hard drive starts to become suspect about this time as well.