When mistakes happen in the workplace, you need to look at the mistake from 3 angles, and you'll need to consider the ramifications for each one.
The Business Level
There was a problem, and it's going to impact the company somehow. Maybe it's losing time, a client, or reputation, but you definitely were the cause, and it's definitely going to give your supervisor a headache.
In situations where there's professional impact, you may get directions from management such as working extra hours, or skipping break to ensure things catch-up. Managers or co-workers won't care about snickers, they just want things running smoothly. Even if they don't ask, staying late to make sure things get caught up is a bit of an unspoken agreement.
The Professional Level
You've impacted your co-workers on a professional level. Usually lost work or a similar setback. The important thing here is that it doesn't impact anybodies personal lives, just their professional ones; the impact will only be felt until quitting time.
If this is a first-time issue, especially if you're new, apologies are good in order, but overall it should slide. If a co-worker is really thorny over your first mistake, that's their issue.
If you've caused issues before, or in rapid succession, you should consider compensating them on a professional level; offer to take some workload off, buy coffee if they missed their brake, and generally try to ensure their day goes smoothly while they iron out your issue. You might be offering to work late (without explicitly saying it).
In either case, make sure they know you'll take any heat from higher-ups (if they don't already know) while passing information up the food chain. The biggest thing at this level is to learn from your mistakes.
The Personal Level.
Your mistake cost someone on a personal level; The most common you'll likely encounter is someone needing to work late because of your mistake.
As soon as you cut into somebodies off-hours, the minimum you should do is offer to stay until they're finished if you are able to assist. If it's only a few extra minutes, even hanging around while doing on your own work is a good gesture just so they know they aren't alone. Don't ask, just stay unless they specifically ask you to leave.
If you're making people stay late enough to conceivably miss dinner - pay for take out; even if it's a team of 7 hungry developers. Also offer yourself up to do coffee runs or errands while they recover for you.
In the event a co-worker is somehow going to get stuck for transportation (e.g. their carpool isn't staying behind) you should drive them if able, or at least offer to pay for a taxi.
Mistakes aren't pay-to-fix
Overall, a mistake should have an appropriate response; buying candy because you made an error isn't going to fix the issue. Sometimes a simple "Sorry I corrupted your build" is correct, other times you may shell out $80 for pizza because 5 people need to work late. Higher-ups won't care about gifts, they just want you to push and make sure the problem is resolved and eveyone gets caught up.