Crumbly cookie dough
Usually when cookie dough falls apart, it is because the flour is not sufficiently hydrated, that is to say, it has not absorbed enough water.

There are two factors at play:


The ratio of liquid in the recipe (from eggs, milk, water, juice, coffee, or any other source) to flour (by weight)
The amount of time that the dough has had to rest and absorb the water.


Typically, when you are saying your dough is crumbly, it is going to be a rolling type cookie, like a sugar cookie.  These often benefit very much from a resting period of at least four hours in order to fully hydrate the flour.

Another common cause is measurement.  Flour, especially when measured in a measuring cup, is very easy to mis-measure, and the ratio of flour to liquid is extremely important.  I strongly recommend weighing flour for all baking purposes.  Quality recipes and cookbooks will indicate flour by weight, or tell you how much their standard cup weighs.  If you cannot find this information for a particular recipe, using 4.25 ounces of flour by weight for each cup is a good guess.

What you don't want to do is add flour to the recipe; that will only exacerbate the problem.

See also: What does an overnight chill do to cookie dough, that a 4 hour chill doesn&#39;t?