Hello, my name is***** and I have over 20 years of experience as a veterinarian. I understand that you are concerned because your fellow was breathing heavily for a couple hours and you noticed that his gums are black.
Rapid breathing can be due to pain, excitement, anxiety, or getting overheated. In some instances it is also due to poor oxygenation due to anemia, bleeding, heart or liver disease. Because your fellow seems normal otherwise now it seems less likely that his panting was due to poor oxygenation, but you should make sure his color is good now. If his gums are all black look at his eyelids and tongue. Those should be a nice bubblegum pink.
Some dogs have both pink and black gums, it is a normal variation in pigment of the gums. We tend to see it more in black and white, or dogs that have black pigment or ticking in their coat.
This is a picture of a dog with normal gums that have some black pigment.
The black gum areas, if they are flat and look like just pigmented areas of the gums, may be normal color. In some cases with severe dental disease they may be a response to chronic inflammation, and those will be seen around areas of infection, but that is less common.
If they are raised however and nodular that can indicate an oral melanoma and those should be checked by his veterinarian.
If the areas were bleeding and looked purple or blue/red that can indicate bleeding and bruising. See the picture in the link below for an example. Notice this dog has areas of bleeding/bruising as well as normal black pigment. Also notice how rather than a nice bubble gum pink his gums are otherwise very pale/white in color:
Dogs with bleeding/bruising are having difficulty clotting. That can be due to liver disease, bone marrow disease, autoimmune disease (body attacks itself), exposure to a toxin (anticoagulant rodenticides) or a drug reaction. These pups are in real trouble and should be seen by a veterinarian on an emergency basis.
Without seeing your fellow's gums it's hard to know how concerned to be. But if he is nice and pink otherwise and his black gum color is flat and not raised or ulcerated then he is likely fine. If you want to post a picture use the paperclip icon to upload one from your computer.
Please let me know if you have any further questions.