First, all fish have gills. However, not all fish use their gills for breathing. So most fish can only survive a short time out of water before oxygen deficiency catches up with them and they die.
Catfish, like almost all other fish suck water in through their mouth and squirt it out their gill opening, or fan their gill openings to move water past their gills. The gills are made of capillary-like fingers that absorb oxygen from the water, into the bloodstream.
Did you ever catch a catfish and a day later it could still be alive and seem to be breathing? Many species of catfish can survive out of water, thanks to their swim bladder. The increased amount of blood vessels in their swim bladder essentially functions as a lung. Bullhead catfish, Channel catfish, and blue catfish can all survive long periods out of water provided they remain moist.
Bullheads are well known for burrowing into soft mud and making dome-shaped refuges. When these domes dry out, they become a shelter from arid conditions, the catfish inside coats the walls of the dome with mucus, and basically becomes dormant waiting for wet weather to return.
Walking catfish introduced into Florida and reportedly also found in California, Connecticut, Georgia, Massachusetts and Nevada are native to Asia and can actually breathe air as long as their gills don't dry out, but they absorb oxygen from the air through their gills rather than through water. It is considered to be an invasive species here in the U.S. and was aptly named for its ability to "walk" across dry land, to find food or suitable environments. While it does not truly walk, it has the ability to use its pectoral fins to keep it upright as it makes a sort of wiggling motion with snake-like movements.
There are also other air breathing catfish which are generally found in Southeast Asia. These air breathing catfish are cherished food fishes in their native range where their ability to survive out of water allows them to be kept fresh for market.
In both Pennsylvania and New Jersey, the gar and bowfin are two primitive fish that can gulp air from the surface and respirate internally. These fishes have modified swim bladders for gulping air or specialized gill chambers that mix water and air. These adaptations help them survive when oxygen levels are low.
There are six species of lungfishes which are only found in the Southern Hemisphere in Australia, Africa and in South America. In addition to having gills, lungfishes have one or two primitive lungs for breathing air. This enables them to survive in poorly oxygenated waters. Their lobed fins enable them to crawl across the land. In fact, one species of lungfish must breathe air or it will drown.