Sounds a little like petit mal seizures to me.
The simple answer is, if you don't get quality rest, you'll get that effect. There are quite a few other reasons this can happen, like malfunctioning heart, lungs, glands, and brain of course. Evaluate your stress and sleep patterns first, tho. Medications can sometimes affect quality of sleep, so can stress, eating too much before bedtime, not staying well-hydrated thru the day, and some people have a hard time resting well in winter because of the cold and the furnace coming on and off.
Rule out a sleep problem, and if you still have these spaced-out symptoms, particularly in conjunction with other symptoms, then you should have a complete workup done by your family physician.