We are differentiating between an element and a compound. An element is the simplest, purest form of matter where all of the atoms in the substance have the same mass number (number of protons in the nucleus). They can differ only as isotopes (number of neutrons in the nucleus). An example is carbon (C). A compound is a substance that is composed of molecules containing more than one type of element. An example is water (H2O).
When the black substance is heated in the presence of air, it changes color and adds mass. That is likely because the black substance has oxidized due to the oxygen (O2) in the air. Air is almost entirely nitrogen (N2) and oxygen (O2), and nitrogen is highly unreactive. So the substance has been oxidized, or had oxygen atoms added to it (hence the increase in mass). So the red-orange substance is almost certainly a compound since it would contain more than one type of element (whatever was originally present plus oxygen).
As far as the black substance to begin with, I don't think we can say with certainty whether it is an element or a compound. If it were an element, it would likely be carbon (black powdery soot). But oxidized carbon would be either carbon monoxide (CO) or carbon dioxide (CO2), neither of which are colored solids. So I am tempted to say that the powder is a compound but I don't think that it can actually be proven either way.