This is the defining characteristic of organic molecules. The term "organic" historically referred to substances found in living organisms, and these substances were discovered to always contain carbon.
While there are exceptions to the rule, such as carbon dioxide (CO2), which is considered inorganic despite containing carbon, the vast majority of molecules containing carbon are classified as organic.