There are two factors why oil floats on water: Oil weighs less than water, making oil buoyant in water, similar to a cork or an air-filled rubber duckie that stays on the surface of the water in a bathtub or bucket.
Many oils are less dense than water. Most oils do not dissolve in water, instead the molecules just cluster toward each other and then float up to the surface. If a large amount of oil is poured into water, the oil will spread out and form a “skin” over the water. Oil laying on the water surface changes the surface characteristics, such as, how the surface looks to the eye or how it reacts to disturbances like wind.