Going by Wikipedia's definition, a physical constant is a number "generally believed to be both universal in nature and have constant value in time". The significance of these constants began to be recognized in the late 19th century, partly as a result of the standardization of the measurement system. But their modern prominence is due to Eddington's semi-philosophical project from 1920-30s.
I will start with pre-history. The first quantity acknowledged as universal was the gravitational constant. Of course, at the time the emphasis was not on the universality of the number but rather on the universality of the law it features in. But it was the unification of the Galileo's laws of free fall and Kepler's laws of planetary motion, Heavens and Earth, as it were, that allowed Newton to make a point of "universal gravity" in Principia (1687). As for the constant itself, he only suggested a way of measuring it, and indirectly gave a rough estimate for the order of magnitude. In a way, $\pi$, known since ancient times, is a physical constant too. It measures the angle sum of physical triangles, and hence the curvature of physical space. The speed of light was also measured by Rømer somewhat earlier (1676), but its universality did not really come into view until Maxwell's unification of optics with electromagnetism in 19th century.
The efforts to standardize and unify units were undertaken first by the committee on weights and measures after the French revolution (1799), and then by an international effort in 1860-80s that implemented Maxwell's proposal of taking units of length, mass and time as base units and reducing the rest to them see History of the metric system. Many constants (not necessarily universal) naturally appeared as conversion coefficients. Avogadro constant is an example, see Fundamental Physical Constants: Looking from Different Angles by Karshenboim for more details. By the end of 19th century the notion of a physical constant was part of the folklore. For example, Planck was aware that he was proposing a new fundamental constant in his black body radiation formula.
However, it was not until 1920s that Eddington undertook a systematic study of "constants of nature" and their relationships in his efforts to effect a grand unification of all physical theories. They start appearing as a theme in his Mathematical Theory of Relativity (1923), and come into prominence in
The Charge of an Electron (1929) and New Pathways in Science (1935). He promoted the special role of dimensionless constants, the only ones that are "truly" universal, in particular with his numerological speculations about the fine structure constant. From Kragh's
On Arthur Eddington’s Theory of Everything:
"The fine-structure constant was not the only constant of nature that attracted the attention of Eddington. On the contrary, he was obsessed by the fundamental constants of nature, which he conceived as the building blocks of the universe and compared to the notes making up a musical scale: “We may … look on the universe as a symphony played on seven primitive constants as music played on the seven notes of a scale” (Eddington 1935, p. 227).
The recognition of the importance of constants of nature is of relatively recent origin, going back to the 1880s, and Eddington was instrumental in raising them to the significance they have in modern physics (Barrow 2002; Kragh 2011, pp. 93-99). Whereas the fundamental constants, such as the mass of the electron and Planck’s quantum constant are generally conceived to be irreducible and essentially contingent quantities, according to Eddington this was not the case. Not only did he believe that their numerical values could be calculated, he also believed that he had succeeded in actually calculating them from a purely theoretical basis."
While Eddington's numerology and grand unification did not survive the test of time, the prominence of universal constants in physical theories, and efforts to derive them from some sort of grand unified theory continue to this day.