I've heard this question asked quite a few times, so it's worth a lengthy answer.
Let's get some things clear and then we can get to answer your question.
Guess what you call someone who gets stock in exchange for money or work? An investor. So one easy way to look at this is that you're investing in this company. As such, you should analyze it the way any other investor would. Does the team look like they know what they're doing? Are they experienced? Does the market look promising? Do they have enough capital to get this thing off the ground?
Also, most start ups fail and as a rule, people investing in startups should only put in money that they're willing to loose. Chances are that this will fail, and all the time you put in is going down the drain.
Now the good news. It's an opportunity to learn about the world of startups. You'll work closely with the founders, and learn new things. In many ways making sure that this is good team that you can really learn from is more important than how much stock you get. After all, the likelihood of getting rich on working after hours are very sliim.
Having said that, you still need to figure out what's a fair deal. The easiest thing is to have them make you an offer. I'm assuming that they're more experienced, and have some idea of what they want to offer you. Always think in percentages, not number of shares. In other words, if they say you get 5000 shares, you need to know how many total shares are allocated. Obviously 5000 shares out of a million are very different than 5000 out of 100 million.
Beyond that, it's really hard to come with numbers, but I'll try to draw up some kind of scenario. Let's say that the company's worth is 50% tech and 50% business (I don't know anything about the business, you can come up with your own assumptions). The tech part is the code. Let's say that there are 1000 hours of code already invested and you and one other coder put in another 250 hours. So the two of you together contributed 20% of the code (250 out of 1250), and you contributed 10% of the code or 10% of the 50% that is the tech contribution to the company which means that you should get 5% of the shares. There might be other considerations, that the founders took earlier risks, came up with the idea, and you should only get 2%, but at least we have a ball park idea of how to value you contribution.
At the end of the day, though, it's much easier to just figure out if it's an opportunity that seems interesting, get them to make you and offer, negotiate a bit and get to work. You'll learn a lot, and gain experience that'll guide you for the next time something like this comes up.