Gravitational lensing : an astrophysical tool