Fish can survive in a dirty tank without a filter for about three to seven days. However, it is important to regularly clean the tank to prevent the build-up of dirt and maintain the health of the fish. A filter can help keep the water clean by removing debris and maintaining water quality.