The Torah contains commandments related to worship, personal relations, and support for social welfare programs. It is this last group that I'm interested in.
For example: "At the end of every three years, bring all the tithes of that year’s produce and store it in your towns, so that the Levites and the foreigners, the fatherless and the widows who live in your towns may come and eat and be satisfied" - Deuteronomy 14:28-29
and
"When you reap the harvest of your land, do not reap to the very edges of your field or gather the gleanings of your harvest. Leave them for the poor and for the foreigner residing among you. I am the LORD your God." - Leviticus 23:22
While many of the commandments have listed penalties for violations, I'm not familiar with any biblical passages for failing to tithe or observe similar social welfare actions. Do we know if these commandments were enforced by the courts of ancient Israel? If so, what was the penalty for failing to observe these commandments?
Generally speaking, the bible does not list penalties for failing to do something (with a few exceptions), only for transgressing. That is the case with most of the positive commandments involving treatment of the poor in the bible, there's no explicit punishment.
The only exception is that untithed produce is forbidden to be eaten with a penalty of karet, excision, which in Jewish tradition is death by heavenly decree (exactly what that means is unclear, but it's not good. Human courts can give lashes for karet-prohibitions, which gets you out of "karet", but is actually a considered a lesser punishment). I think this is thought to be excommunication by many because that's sort of how it sounds in the bible (karet means "cut off", the usual wording is "he/her/they will be cut off from their people). Theoretically a Rabbinic court could compel a person to perform a positive commandment, such as by declaring the corners of his field ownerless, but I am unaware of anything like that happening.
And that gets us into the problem with this question. We don't have actual historical records of what people were doing with this in ancient Israel. We don't have court records. We have some from the rabbinic period, but even that (as above) only partially answers the question because while they wrote things down we don't have positive record of everything they did, and it's centuries after the period you're asking about. So it is not really possible to actually answer this question.
While I'm not certain about enforcement in the courts of ancient Israel, besides to say that I've seen various sources say that there is no real record of how these punishments were actually administered in biblical times, the typical interpretation is that where no punishment is prescribed, flogging (lashes, whipping) is the default punishment. Talmudic law expanded on this, and defined which punishments were to be flogging, and which would not. These lashes are to be given 1/3 on the front of the body, and 2/3 on the back, and they could not exceed 39 total according to Talmudic law, and are given in sets of 3. Furthermore, if a person did not appear able to withstand the lashes, they were postponed until the person was healthy enough to undergo them. The number of whips can also be decreased if one doesn't appear able to withstand the punishment. A punishment like this can only be administered by the Sanhedrin, which does not exist in any form in the modern world (and hasn't for a long time, despite attempts at revival), which means this punishment could not be given out in modern times.
The Deuteronomy 14:28 passage you look at is known as "maaser ani", otherwise known as the "poor tithe" (not to be confused with tithes given to the priestly class, for example, or tithes meant to set aside food to be consumed in Jerusalem annually). The Mishnah points out that the amount left should not be less than 1/60th of your crop, though this is not an obligation if your field has been harvested by non-Jews, robbed half after the owner harvests half (if it's the other way around, the obligation stays in place), etc.
I won't bore you with all of the rules, which go on in quite some detail about various possibilities, but I've had some trouble determining the exact punishment for not fulfilling the poor man's tithe. You can be flogged for eating from that portion, but I'm not certain on the punishment prescribed for harvesting and selling it, for example. I also haven't found a specific amount to be flogged, but it appears that the punishment is dependent on how much one eats, though eating any is punishable, same as eating an ant (as compared in the Talmud).
Lashes are also prescribed for Leviticus 23:22, according to the Talmud (Makkot 16b), and I similarly don't see a set, prescribed amount.