What is the speed of the molecules dependent upon in a substance?
Depends on the phase of matter, but I would say both the molar mass and the temperature for gases. If liquids or solids, temperature is a bigger factor because it can change, whereas molar masses cannot.
The speed of molecules in a gaseous substance is typically reported as the root-mean-square speed,
#upsilon_("RMS") = sqrt((3RT)/M)#,
#M#is the molar mass in #"kg/mol"#of one particle ( #"N"_2#, #"Ne"#, #"CO"_2#, or some other gas).
#R#is the universal gas constant, so clearly, this equation is generally for gases.
#T#is the temperature in #"K"#.
So, the lower the molar mass, the faster the gas. Or, the higher the temperature, the faster the gas.
If we are referring to liquids vs. solids, yes, molar mass affects their speeds. However, they don't change (obviously, molecule
Temperature, of course, can increase, and that is an increase in the average kinetic energy of the set of molecules. That means they move more, since kinetic energy is the energy of motion.
However, liquids and solids have more limited degrees of motion than gases, so their speeds aren't affected as much, even though they do speed up at higher temperatures.