Like the other metals, tin is one of the heavier kinds of atoms. Every atom of tin has 50 protons and 69 neutrons in its nucleus (depending on the isotope; the exact kind of tin). Like other metals, all tin atoms form inside older stars that have become supernovas.
On Earth, tin is very common. Tin usually combines with oxygen molecules to make an igneous rock called cassiterite, usually found with granite. We get tin by crushing the cassiterite and roasting it in ovens. Tin melts at pretty low temperatures, so you can melt tin ore just in a regular wood fire.
Like lead, tin is too soft to be very useful by itself, but if you mix tin with copper you get bronze, which was the first metal that people used for tools and weapons. So in the Bronze Age, tin was a very important metal, but it became less important once people began to use iron. In the Middle Ages, people mixed tin with a little copper, antimony, and lead to make pewter, a cheaper metal that looked like silver, to make imitation silverware and jugs. Today people use tin mostly to coat steel for tin cans like for canned soup or canned peas, to keep the cans from rusting. What people call tinfoil was once made of tin but now is made of aluminum.
Bibliography and further reading about tin and atoms: