How long your freshwater fish can live without a filter depends on the species of fish and your aquarium conditions. Certain types of fish can spend their whole lifespans -- in some cases, a decade or more -- filterless; others won't make it through a single day. In addition, cleanliness, gravel and live plants determine whether some species can live without a filter.
Labyrinth fish are named after their specialized labyrinth organs, which allow them to breathe air from the water's surface. Like other fish, labyrinth fish can use their gills to breathe oxygen dissolved in water, but they aren't as dependent on it. Though most do need to breathe some of their oxygen from the water, they can live with much lower dissolved oxygen levels than most other fish. Labyrinth fish include gouramis and bettas, or Siamese fighting fish.
Like labyrinth fish, goldfish can supplement the air they breathe through their gills by breathing some surface air. They currently are not classified with labyrinth fish, and the jury is still out on whether their labyrinth organs serve a respiratory function. Either way, the effect is the same: though they need some dissolved oxygen, they don't rely on it completely and they can live in ponds and tanks that lack filters.
How long other fish can live without a filter depends on the amount of dissolved oxygen in the water, the species' specific oxygen requirements and the size of the individual fish. Some species can survive indefinitely if your tank is heavily planted, since plants add oxygen to the water. The rule of thumb is that fish who live in ponds in the wild can survive without a filter, while fish from streams and rivers can't because they need a current to generate enough oxygen. All non-airbreathers will die in an unplanted tank as soon as the available oxygen is used up. This usually happens within hours.
Filters serve two different functions that allow fish to survive and thrive in aquariums. The first is aeration. Filters add dissolved oxygen to water when they create a current that disturbs the surface. The second is cleanliness. Filters provide biological and physical filtration -- biological filtration by encouraging beneficial bacteria, physical filtration by removing solid waste. You can do both of these without a filter.
If you have air-breathing or pond fish, you can keep them healthy in a filterless tank by providing ample dissolved oxygen, biological filtration and regular cleaning. Provide heavy plant cover to keep your water oxygenated -- floating, fast-growing, hardy plants such as elodea (also known as anacharis) are ideal for bettas, gouramis and goldfish. Gravel must be at least 3 inches deep to provide an adequate bed for biological filtration. You must do a 25 to 40 percent water change two to four times a month with a special siphon called a gravel vacuum to remove unfiltered waste from the water.