Do dolphin have gills? No. They are not fish. They can't stay underwater forever, the way fish do. They must come to the surface to breathe, just like we would. If they can't (if, for example, they were caught in a fishing net), they would drown, just like we would. They are mammals and breathe with lungs, just like all mammals do.
How long can they hold their breath? As long as 15 minutes. By contrast sperm whales can stay down as long as an hour or more. Most humans would only last a minute or two, without a lot of training. Fortunately for those of us who enjoy watching them, the dolphin ordinarily don't stay down more than a half a minute or so. The blowhole on their back makes it possible for them to roll up to the surface, exhale and inhale, then roll back down below the surface. Occasionally, we hear them getting choked with water in their blowhole and they will stay at the surface, coughing, until they clear their airway.
So how do they stay down so long? One reason is that when they breathe, they exchange a much higher percentage of their lung volume than we do. Scientists think that they can exchange over 70% of the air in their lungs, while humans normally exchange less than 20% in a normal breath.
Oh, and don't get too close. When they come to the surface, they clear that water pretty quickly (like about 100 miles per hour!) which sometimes makes for a large spray. You don't want to get covered in "dolphin snot"! They have a lot of nerves around their blow holes, which are very sensitive. So, they don't like to be touched anywhere near their blowholes.
So, how do they sleep? Well, the answer is that we aren't sure, but there is a popular theory that only one side of their brain will sleep at a time - the other side continuing the normal waking functions. Just imagine how much homework you could do, if you never had to sleep!