Charity is a commandment that is incumbent on everyone and it teaches us the very important lesson that the money we control has been entrusted to us by God. One should not make the mistaken assumption that if a person works for his money then he has "earned" it and it belongs to him without any preconditions. Rather, whatever money we have has been granted to us by God and we must prove ourselves worthy of being the recipients of it. Therefore, we take some of our "hard earned cash" and give it to those that are less fortunate then ourselves.
The Code of Jewish Law, Yoreh Deah 249, states that one fifth is a maximum amount that should be given to charity and the minimum is one tenth, ibid. Remah. This should be calculated from one's net income and not gross. There are various sources in the Torah for the concept of giving a tenth to charity. Avraham gave Malkizedek a tenth of all he had, Bereshit 14:20. Yaakov pledged that he would give a tenth of all he had to God, ibid. 28:22. There are numerous mentions of the concept in Nach, Midrashim, the Talmud and the Commentaries.
I thoroughly recommend a book in English by Cyril Domb entitled Maaser Kesafim, published by Feldheim, it comprehensively covers all the laws pertaining to one's obligation to give charity.