Previously what is called now "natural sciences" was called "natural philosophy". I'm interested in details, what was so wrong with the name "philosophy" so the name "science" became preferred?
What was called "natural philosophy" is not what is now called "science". The latter, with its specific institutions and standards, only started forming in 17th century and was not fully formed until mid 19th. While Newton still called his opus magnum Mathematical Principles of Natural Philosophy in 1687, after much professionalization and institutional growth in 18th century "men of science" became self-conscious, and sought to distinguish their more disciplined endeavor from contemporary natural philosophy, such as Schelling's, see Naturphilosophie. At the time, German idealists and romantics had their own ideas as to what "science" should mean (recall Hegel's Science of Logic), and "Newtonian science" was not exactly a term of praise to them. It was to be surpassed by some kind of "higher Science" of a more speculative and holistic nature. This did not take.
Whewell's promotion of "inductive sciences" in History of the Inductive Sciences (1837) and Philosophy of the Inductive Sciences (1840) contributed to cementing the change and emphasizing the "inductive method", which of course goes back to Bacon. Comte distinguished "positive sciences" in The Course in Positive Philosophy around the same time (1830-1842). Whewell also coined the term "scientist" (and "physicist"), by analogy to "artists", in an 1834 review of Mary Somerville’s On the Connexion of the Physical Sciences, but it did not prevail over "men of science" until 1870s in the US, and the Royal Society of London, the British Association for the Advancement of Science, the Royal Institution and the Cambridge University Press still rejected “scientist” as late as 1924. The British surrendered only after World War II, see How ‘man of science’ was dumped in favour of ‘scientist’.
Aristotle's episteme ("theoretical" knowledge), translated into Latin as scientia, much predates modern science of course, but one can tell that the meaning was different from the observation that what medieval scholasts were doing was called scientia. Geometry was episteme, but mechanics was techne, "practical" knowledge. Aquinas took the scholastic formula "science means the certitude of knowledge which is gained by demonstration" almost word for word from Averroes, an Arabic Aristotelian. It referred to intellectual study of any kind, from natural philosophy to theology, all of them mostly speculative, and "demonstrations" included not just Euclid's ones but also proofs of God's existence like Anselm's. Some elements of science in the modern sense, as opposed to natural philosophy, can be attributed to Hellenistic science, see e.g. Russo's Forgotten Revolution, and medieval Islamic science, but they were neither self-consciously "positive" nor "inductive" nor institutionalized. It is an attribution in retrospect.
It is a gradual process. All sciences were born from "philosophy". Philosophy is just a verbal speculation about the thing we do not know exactly. When speculation on a subject reaches some degree of maturity, some truth can be discovered and proved. Then a science is born. Ancients started to speculate about nature. Then gradually, mathematics and astronomy became sciences (when they obtained correct, proved results). Astronomers and mathematicians were still called philosophers for long time. The rest remained philosophy. At the time of Newton, mathematics was already completely separate but physics and chemistry were called "natural philosophy". Then physics was born, then chemistry, etc. So the area of phisolophy always shrinks while the area of science gradually expands.
But this is a very slow process which started about 6 hundred years BC and still continues. The language lags behind the process. In 19 century one mathematician still could call another mathematician a "philosopher", but then this was already somewhat unusual.