This command is found in Image>View/Sap to Grid.
This option in a way magnetizes the grid you have set (see Show Grid). When you move a layer or a selection, they will get automatically onto the grid when they are near them. This allow to place them acurately.