Apples float because their overall density is less than that of water. Their density is less than water because 25 percent of an apple's volume is air.
Objects that are less dense than water float when put in water, whereas objects that are more dense than water sink when put in water. According to Archimedes' Principle, "A body immersed in a fluid is buoyed up by a force equal to the weight of the fluid displaced." The air pockets in between the cells of an apple allow for enough air to be captured inside the apple to create an overall density less than that of water.