When the soil is wet, the particles are lubricated by the water; particles of sand, silt and clay in the soil can more easily slip past each other. When pressure is applied to the surface of wet soil, it compacts to a much greater degree. Avoid using a lawn roller when the soil is wet because it will cause the soil to become too packed. A compressed layer at the surface of the soil will make it difficult for seedlings to establish roots and grow to maturity.
If the soil is moist, the soil roller may cause over compaction. If you are using a lighter lawn roller that just slightly compresses the surface you may be okay. Reduce the amount of passes you make with the roller and overall traffic over the soil. If you are using a lawn roller on sod that has just been planted, it may be moist for a long time as it becomes established. In this case you will need to use a lawn roller to get the sod flat and in full contact with the soil.
For bare ground it is best to apply any kind of pressure when the soil is dry and the particles are not lubricated with water. Working the soil will a roller when it is dry will prevent it from compacting too much.
Most lawn rollers are the hand pushed or pulled variety. These can be used when the soil is dry, or gently when it is moist. Rollers are also available as implements for lawn tractors. It is particularly harmful to the soil to drive on it when wet. It is best to only use a heavy roller or tractor on dry soil.