The Gemora cited a braisa: The Purim collections must be distributed for Purim (and nothing else). The local collections belong to that town only, and we are not required to be so precise in the matter (how much is needed for Purim, and how much the poor of the city needs), but calves are purchased in abundance, slaughtered and eaten, and the surplus goes to the charity fund. Rabbi Eliezer said: The Purim collections must be used for Purim only, and the poor may not even buy straps for their shoes, unless it was stipulated in the presence of the townspeople that such shall be granted; these are the words of Rabbi Yaakov, who said it in the name of Rabbi Meir. Rabban Shimon ben Gamliel is lenient in the matter (and allows the poor person to use the charity funds for other uses besides the Purim feast). [We may derive from here that Rabbi Meir holds that we cannot deviate from the owner’s intent.]
The Gemora notes that this braisa does not prove that (whoever deviates from the owner’s stipulation is regarded as a thief), for perhaps there too, the reason is that the donors gave the charity only that it should be used for Purim, and not for any other purpose? [Regarding charity funds, there is a significant difference between the two purposes, whereas the two routes discussed in our case are not significantly different than each other, for one is not more dangerous in any way than the other.]
The Chavos Yair quotes a Sefer Chasidim, who derives from this Gemora that if one sends his fellow a gift of food to be eaten on Shabbos, it is forbidden for the recipient to eat it during the weekdays. If he has leftover, he should let the rest of household partake in it, but only on Shabbos. If the donor explicitly stipulated that he should be the only one to eat from it, he may not give it to others.
It would seem from our Gemora that this is not merely an act of piousness; but rather, it is halachically mandated. We can extrapolate further that if one gives money or wine to his fellow and he tells him that is should be used for Kiddush, he must use it for Kiddush, and nothing else. It would be forbidden to buy fish for Shabbos with this money, for Kiddush is a Biblical mitzvah, and eating fish on Shabbos is merely a Rabbinic one.
However, according to the prevailing custom that money is given to Torah scholars, and they are told to use it for Shabbos and Yom Tov, that is only out of respect, but they are not actually being particular as to what it should be used for; in such cases, they could use the money for whatever they desire.
Reb Yosef Engel cites the following Yerushalmi: If one vows to bring a flour-offering on Yom Tov, he should not bring it on a weekday. This is why the seforim write that a transgression committed on Shabbos is more severe than one committed on a weekday, for the holiness of the day plays a role. So too it may be said regarding the performance of a mitzvah; There will be a greater reward for a mitzvah performed on Shabbos or Yom Tov.