Cells show a great variation in their shape. It can be said by the following :-
.Nerve cells are long to conduct impulse from distant parts of the body to the brain and vice-versa.
.The muscles are long and contractile to help in the movement of the bones.
.Xylem vessels are long and elongated to help in the conduction of water and minerals.
.Guard cells in the leaves of plants are kidney-shaped to open and close the stomata to allow exchange of gases.
Therefore, we can say that, the shape of the cell is related to it's function.
hope it helps.. :))