Is it safe to charge a mobile through a laptop? Are there any ill effects? Can it cause any kind of harm to the laptop and/or mobile? On what factors does it depends?
In general there is no problem charging your mobile phone over the USB interface of your laptop.
Read: ExtremeTech: How USB charging works, or how to avoid blowing up your smartphone
I think a usual safety measure is to avoid placing things like passive USB hubs between the laptop and the mobile phone -- particularly, avoid connecting multiple devices on the same port with such techniques. These days I think even that is covered by the electronics in your laptop (the USB port survives such power pull).