Differences between charging with electricity and sunlight

Do you have any such thing that when you charge with the charger it charges you up to 31 days, and when you are in the sun up to 40 days ?? Why is it like that?