there are TWO different flags in the US, and they mean completely DIFFERENT things, although in some cases you should fly BOTH.
The ALFA, or code "A", gives the BOAT privilege - specifically, it exempts it from the requirement to maneuver in accordance with the rules of the road because the vessel is tending divers. In other words, flying it gives privilege to the vessel and thus (if understood by other traffic!) should protect the BOAT from collision. It is ONLY appropriate to fly this from a boat and ONLY IF your boat is physically prevented from maneuvering.. A boat drifting and able to maneuver (e.g. no divers being recovered or discharged at the moment) technically should NOT fly it, although many do. A boat supplying divers with surface-supplied air or with a deco bar hanging below the boat MUST fly it, because the boat CANNOT move without damaging the equipment (or the divers!)
The standard is the ABILITY of the boat to maneuver, not whether doing so would mean compromising a "bubble watch". ALFA is intended for commercial surface-supplied operations where the boat was physically connected to the diver(s) below and was thus physically prohibited from moving. If you're supplying gas via a deco bar or hoses to divers below, or if you have wires (e.g. communication links) tying you to the divers in the water, then it is certainly appropriate to fly it. It is appropriate while you are actually picking up or discharging divers, but are otherwise legally underway (that is, not anchored), as you may have intentionally shut down propulsion engines in order to reboard or discharge divers.
Technically, if you are ANCHORED with non-tethered (not surface supplied) divers below, you should not fly ALFA. Instead, you should fly an anchor ball or, at night, have your anchor light illuminated! Yet there is probably not one recreational powerboat skipper in 1000 that knows what an anchor ball IS!
An awful lot of so-called "commercial" skippers get this wrong and fly ALFA under circumstances where its CLEARLY inappropriate to do so. I've yet to see an anchor ball flown on a charter dive boat, but a lot of them do in fact anchor!
It is also completely inappropriate to fly ALFA if you're diving from shore or otherwise not from a boat. It confers no protection or privilege for the divers themselves, only for a boat tending them.
The DIVER DOWN flag (reg flag with a diagonal stripe) is a warning to vessels that divers are in the immediate area under the surface. It SHOULD be flown as close as is practical to the actual location where the divers are and is ONLY permissible to fly when divers are actually in the water. For divers operating off a boat, it is common to fly it on the boat, although that could be 200' or more from where the divers actually are, especially if the boat is anchored. Most state laws have requirements for approach to a diver-down flag, mandating that approach closer than some specified distance (typically 300' in open water and 100' in a channel or other restricted water) be at no more than idle speed. Many states, including Florida, have specific laws relating to "buzzing" a dive flag as well as either not displaying one when diving or displaying a flag when nobody is actually in the water.
The diver-down flag does not have international recognition in the COLREGS. ALFA does. Outside US territorial waters finding out what is recognized as proper protocol for diving in terms of flag display is probably a darn good idea.