Lemons float in water, while limes sink, because limes have a significantly greater density than water, and the density of a lemon is very close to that of the water. A lemon or lime's density can be calculated by dividing its mass by its volume.
Drop a whole or sliced lemon and lime into a container of water, and notice that the lemon floats while the lime sinks to the bottom. Steve Spangler Science calculated the density of a similar-sized lemon and lime by weighing each fruit on a scale to find their mass, then dropping them into water to calculate their volume by the amount of water displaced. The lemon had a density of 1.02 grams per milliliter, while the lime's density was 1.12 grams per milliliter.
Since water has an approximate density of 1 gram per milliliter, the lemon's density is close enough that it still floats on the surface. The lime's difference of 0.12 grams per milliliter is enough for it to overcome the small amount of air contained within, and thus sink to the bottom.
On the subject of citrus fruits and densities, a whole orange floats in water, but a peeled orange sinks to the bottom. Steve Spangler Science suggests this is because the orange's peel is porous and contains air, unlike the thinner and harder rind of a lime, which sinks to the bottom with or without the peel removed. When an orange's peel is removed, the density of the orange's flesh differs from that of water by a significant enough margin that, just like a lime, it sinks to the bottom.