The concept that the total amount of matter in the universe is constant dates back to the ancient Greeks. However, the Law of Conservation of Mass (or the Principle of Mass/Matter Conservation) as a fundamental principle of physics was first described by Antoine Lavoisier in 1789.
This law states that, despite chemical reactions or physical transformations, mass is conserved -- that is, it cannot be created or destroyed -- within an isolated system. In other words, in a chemical reaction, the mass of the products will always be equal to the mass of the reactants.
This law was later amended by Einstein in the Law of Conservation of Mass-Energy, which describes the fact that the total mass and energy in a system remain constant. This amendment incorporates the fact that mass and energy can be converted from one to another. However, the Law of Conservation of Mass remains a useful concept in chemistry, since the energy produced or consumed in a typical chemical reaction accounts for a minute amount of mass.
We can therefore visualize chemical reactions as the rearrangement of atoms and bonds with the number of atoms involved in a reaction remaining unchanged. This assumption allows us to represent a chemical reaction as a balanced equation, in which the number of moles of any element involved is the same on both sides of the equation. An additional useful application of this law is the determination of the masses of gaseous reactants and products. If the sums of the solid or liquid reactants and products are known, any remaining mass can be assigned to gas.