-prize (they have to get paid money or something of value)
-consideration (they have to pay to participate)
-chance (so skill games are exempted i.e. chess)
If any of those is missing, it is not gambling.
Zynga Poker does not have a prize but they have consideration and chance, thus it is not gambling. There are legal subscription poker sites (i.e. clubwpt.com) that do not require people to pay, so no consideration - but they have chance and a prize. Not gambling.
We ran a leaderboard contest last month to get some more alpha testers and gave $500 to the top 10. It was free to participate (no consideration) and our game is (we think) a game of skill, not chance. So we were confident it wasn't gambling and thus was legal.
Consult your attorney before making any business decisions, but thats the gist of it.