The Rambam in his laws of giving to the poor answers this question by outlining eight degrees of preference in giving charity. They are as follows, with #1 being the most preferable and #8 and proceeding in order of more to less preferable:
1. Helping the recipient to become self-supporting through charity, partnership or a loan.
2. Giving charity while the giver’s and receiver’s identities remain hidden from each other.
3. Giving while hiding the identity of the giver from the receiver.
4. Giving while the receiver’s identity is hidden, but the giver’s identity is known to the recipient.
5. Giving without being asked.
6. Giving when being asked.
7. Giving graciously, but less than one should.
8. Giving reluctantly.
In addition, it is important to consider which recipients are preferable. Following are some guidelines:
Non-Jews. The Rambam quotes several verses from the Torah at the beginning of his laws on giving to the poor. Not all of these deal exclusively with Jews. The Minchat Chinuch derives from this that giving to non-Jews is also part of the Torah mitzvah of tzedakah, but giving to a Jew in need is preferable and has a greater emphasis in the Torah. In addition, giving charity to non-Jews was encouraged by the Rabbis in order to maintain positive relations with other peoples.
Family. It is preferable to help those in need who are closest to the giver. The giver’s family and home-town are preferable. The people of Jerusalem also have a preferred status.
Defining poverty. The Talmud leaves the definition of the needs of the recipient very broad. There is a principle of “Dei mechsoro”, meeting the needs of the individual case. This depends on the recipient’s previous and expected life-style.
When considering the obligation a Jew has towards tzedakah (and it is an obligation, beyond a suggestion), one must consider both quantity and quality. When it comes to quantity, most sources, building upon the Biblical models, agree that tithing is the goal, or perhaps even the minimum. The major contribution that our ancestors gave to support the "non-profits" of their time was called מעשר/ma'aser, from the Hebrew root meaning "10." They gave a tenth of their income/produce so that the Jewish institutions of that era could be supported. Granted, it is unclear how much civic tax our ancestors were obligated to give beyond that tenth; in our lives, we are enjoined to give tzedakah in addition to our civic tax load. Nonetheless, using one tenth of one's income as a benchmark is a proper way to enter the conversation of quantity.
When it comes to quality, the dominant idea (though by far not the only idea that animates this discussion) for hundreds of years has been the one articulated by Maimonides, the Rambam, who lived from 1134 to 1204. A physician, scientist, philosopher and general savant, Maimonides was chiefly a commentator on Jewish texts and an expert and comprehesive legalist. His code of Jewish law remains a standard that Jews turn to for basic "how to" information on Jewish practice. His famous contribution to the conversation about tzedakah noted 8 distinct levels of giving. The lowest level (which yet still fullfills the basic obligation) is to give unwillingly, in a besmirching manner. As the levels get higher, Maimonides takes into account the experience of the recipient of the tzedakah and the desire to preserve his/her dignity; the value in giving without having to be asked or begged; the value of anonymity in giving; and ultimately, the clear goal of any tzedakah, which is to build the self-sufficiency that will obviate the recipient from needing to rely on tzedakah in the future. Therefore, the highest level according to Maimonides is to give a person a loan, enter into a business partnership with him/her, or help him/her find employment "to strengthen his hand so that he no longer need to be dependent on others." That is the kind of giving to which Jews should aspire. Since such situations do not always present themselves, aspiring to the penultimate level of giving doubly blind, where neither the recipient knows the benefactor, nor the benefactor knows the recipient, is an extraordinary act of goodness itself. Breaking it down more simply: give enough, with a smile, and so that those who received may one day be able to give themselves.
The great Jewish philosopher and sage, Moses Maimonides, answered this question for us in the twelfth century, in his Jewish Law code, the Mishneh Torah, Hilchot Mat'not Ani'im 10:1,7-14. He teaches us there are eight rungs on the ladder of tzedakah.
The lowest rung – someone who gives to the poor, but unwillingly.
Next – giving to the poor gladly
Someone who gives willingly, but only after first being asked
Someone who gives before being asked
Someone who gives without knowing who is the recipient, but the recipient knows the giver. Maimonides gave the example of the greatest sages who would tie coins up in the corners of their robes, and the poor would pick off the coins as the sages passed by.
The next rung is knowing who your recipient is, but they do not know who you are. Maimonides said the sages used to leave gifts of money in the doorways of poor people’s houses, and he adds that this is a meritorious thing to do, but only when those in charge of the community’s tzedakah funds are not trustworthy.
Next is giving without knowing the recipient, and the recipient does not know the giver, as when you put money into a community tzedakah box.
The highest level is giving a gift, making a loan, or forming a business partnership with the poor person, so that he will have a profession and no longer need tzedakah.