For about as long as human history. In the neolithic, we used stones found on the ground for primitive tools, although calling that 'mining' is a bit of a stretch. The earliest phase for settled societies was the Chalcolithic, or Copper Age, which was a transitionary period between the Stone and Bronze Ages, lasting from about 5500-3300 BCE (as a very rough estimate). This was a time when we worked copper into tools, ornaments, etc. This was followed by the Bronze Age, lasting from about 3300 BCE to 1177 BCE (the typical date for the Bronze Age Collapse, a systemic breakdown of civilization which was much more severe than the more famous fall of the Western Roman Empire). This period was the first major flourishing of civilization, relying upon bronze, which was created by alloying copper with tin (and sometimes other substances). Bronze is much stronger than copper and holds a better edge, which was a key advantage. Copper and especially tin have lower melting points than iron, which made it more accessible for metallurgy. After the Bronze Age collapse, the breakdown in long-distance trade of tin (which is required as an alloy for bronze) forced societies to seek an alternative, namely iron. With better furnace technology, ironworking became feasible, and the addition of carbon produced steel, which exceeded the properties of bronze. Of course, other ores were mined throughout this period, such as malachite, turquoise, and especially gold. However, the mining of copper, tin, and iron were most significant.
Generally speaking, mining advanced along with society. Classical antiquity saw a significant amount of mining, with the ancient Greeks and Romans mining precious metals to prop up their economies. The silver mines of Laurion were a major source of wealth for classical Athens, although it was also infamous as the worst place for a slave to be employed. The Romans significantly expanded the scale of mining with their massive slave apparatus. Later, the medieval and early modern eras would see further innovations, and of course the industrial revolution transformed mining (as it did life in general).
While I've focused on the Near East and West, mining was pursued by major civilizations worldwide, such as in East Asia, Africa, the Indian subcontinent, and the Americas. However, pre-Columbian American civilizations mostly mined copper and precious metals, and often used these in decorative/ceremonial contexts, as opposed to the greater emphasis on utilitarian use in other civilizations; use of iron was very limited, and was mostly obtained from meteorites. You could generally describe pre-Columbian American civilization as remaining in a Chalcolithic/Copper Age state, while the Old World (Eurasia & Africa) progressed to bronze and iron (this has to do with the fact that the Americas were isolated by two oceans, while there was continuous trade and exchange among Old World civilizations; this is of major import to world history, a tangent I won't develop here).
Since you're asking about the earliest mines, there's an important consideration there. We're used to mining metals deep under the earth, and almost never seeing them on the surface; in ancient times, it was otherwise. Early civilizations found metals right on the surface or at shallow depths, where it was quickly accessible (this is also true of coal). We've long since exhausted most easily available deposits, so that modern mining must delve much deeper than the shallow pits & trenches you would've often seen in earlier times.
Feel free to critique or question further; however, I believe this covers the topic adequately.