As a student, how much time should I spend helping other students with research? Assume that one has a skill (assume, programming) and is one of the very few in the department to have it. The other students need a bit of this skill for their projects and you help out when you can.

Where do you set the limit for how much effort/time you spend on helping others this way?

Pros:


You get insight into other students' work.
It's a welcome break from our own research
Maybe earns you a second/third author for setting up the experiment
Networking !


Cons:


Effort/Time spent
You don't necessarily improve your skills (For instance, coding in Python for someone else doesn't augment my Python skills by much. What I do might be really routine)
You tend to have a soft commitment towards that project. For instance, if I start working on it as a favour, it doesn't really come off well if I leave 'em midway.


EDIT: I do enjoy the work so long as it is at least a little challenging. I often get really n00bish questions and that is when I start reconsidering my stance on helping people.
You forget one consideration: do you enjoy using that skill? To take your own example, I enjoy programming, and even though I might not learn or get anything technical from it, I enjoy solving someone's else problem with some lines of code :) Of course, one should be careful of the time spent and the reward you can get from it, but doing something you enjoy is very different than doing something you can, but don't particularly enjoy doing.

For instance, I can probably install a server and manage a website (with a CMS) for someone, but I don't enjoy it, so I would be very explicit about the benefit (I do that for you if you do that for me). But I could do some cool coding on my free time. 

On a completely different aspect, it also depends if you intend to stay in academia: it's a very small world, and the person you're doing a favor to today might be the one sitting on your tenure committee in 20 years (if you work in the same department and all stay in academia, it's quite likely that your paths will cross again at some point in the future).