I can't speak for those who stayed, but I do know a source covering those who didn't:
http://www.genealogical.com/index.php?main_page=product_info&item_number=9946&NLC-GenPointers1
Around a quarter of the Continental Army in fact deserted.
It's also worth noting that quite a few historians of the period have noted that due to the cash incentives for enlisting, there were in fact known individuals who deserted only to re-enlist and collect the cash bonus again. So there was also a definite financial motive in at least some of the Revolutionary War soldiers.
That said, think about it from the British perspective. Their desertion rates were probably as bad if not worse since they were being ordered to fight in a foreign land. This was why they had to hire so many Hessians to begin with (1/4 of the British forces were Hessians) - and how one in six Hessians ended up settling in America after the war altogether.
Edit- spelling, grammar.
As Inspector /u/Zinegata noted, a large number of Continental soldiers did desert during the war. However, a greater number clearly stayed under arms, even in the face of starvation, poverty, and frequent defeat. I'll add to the list, as per Carolyn Cox's A Proper Sense of Honor, an officer class that often seemed more interested in asserting their social dominance than running an effective army. Finding the reason why soldiers endured all this still keeps historians (like me!) employed, thankfully.
Historians can be a cynical lot. It's easier, in certain ways, for us to attribute human actions to larger economic forces. Still, sometimes we need to acknowledge the power of ideology. Such is the case of the Continental Army, where something beyond the usual mix of desperation and fear of discipline kept the soldiers in their ranks.
Charles Royster tackles this in A Revolutionary People at War. Looking at mostly New England soldiers, Royster found a mixture of religious fervor and political ideology. If God is good, and a political society structured around the Enlightenment ideals of personal liberty and virtuous, active citizenship is good, then by fighting for the later they were serving the former. Soldiers from other colonies often did away with or reduced the religious thread from their ideological motivations, but kept a devotion to the cause over other, practical concerns.
What's notable here is that the soldiers really did have the power to destroy the army. Mutinies became more frequent and serious as the war dragged on. Regiments from Connecticut, New Jersey, and Pennsylvania all mutinied at one point or another, in addition to many other smaller flare-ups of discontent. For the most part, the same soldiers who began these mutinies ended them. Joseph Plum Martin, memorialist and onetime mutineer, remembered that hunger and cold drove him and his fellow soldiers to protest against their treatment by the army, but devotion to the cause made them return to order quickly. Only the Pennsylvania line mutinied so severely that Congress decided to negotiate a settlement with them. While Washington sent troops to crush the next mutiny that cropped up, the situation had already resolved itself by the time they arrived on the scene.
It's hard to know the minds of the enlisted men of the Continental Army, as they left behind so few written records. Those that did record their thoughts and experiences seem to indicate that belief in the political goals of the American Revolution played a major role in keeping the army from resolving in the face of keenly felt hunger, nakedness, and mistreatment.