A substance will float on water if it has a lower density than water. Therefore, ice floats on water simply because it is less dense than water.
Water is unlike other substances in terms of changes in density. Normally, substances expand when heated; the molecules move further apart and the substance becomes less dense. And normally, a substance contracts when cooled; the molecules move closer together and the substance becomes more dense.
Water also behaves normally and contracts and becomes denser when it's cooled; however, it stops contracting when it reaches 4°C. At this temperature, water has the highest density it can achieve. When water is cooled below 4° C, the water molecules start arranging themselves further apart from each other, i.e. they start expanding. This decreases its density. At 0° C it becomes ice. Below 0° C, ice keeps on expanding and becoming less and less dense. At any point, ice will be less dense than water and will thus float on it.