You can crop layer in two ways:
Crop to selection
Crop to content
The
command crops only the active layer to the boundary of the selection by removing any strips at the edge whose contents are all completely unselected. Areas which are partially selected (for example, by feathering) are not cropped. If there is no selection for the image, the menu entry is insensitive and grayed out.The Crop Tool, or the Crop to Selection command which let you manually define the area to be cropped.
command automatically crops the active layer, unlike theThis command removes the largest possible area around the outside edge which all has the same color. It does this by scanning the layer along a horizontal line and a vertical line and cropping the layer as soon as it encounters a different color, whatever its transparency.
You can use this command to crop the layer to the dimensions of a subject that is lost in a solid background which is too large.