Goldfish do not need light to survive, but they do need a consistent day-night cycle to stay healthy. In fact, goldfish can be kept in total darkness for short periods of time with no ill effects. However, if goldfish are kept in the dark for extended periods of time, they may start to develop health problems such as sleep deprivation, impaired vision, and a weakened immune system.
Additionally, goldfish are diurnal animals, which means that they are naturally active during the day and sleep at night. If goldfish are kept in the dark for extended periods of time, it can disrupt their natural sleep cycle and cause them to become stressed or anxious.