Typically one expects that the intervals between consecutive occurrences of a particular behavior will have a characteristic time scale around which most observations are centered. Surprisingly, the timing of many diverse behaviors from human communication to animal foraging form complex self-similar temporal patterns reproduced on multiple time scales. We present a general framework for understanding how such scale invariance may arise in nonequilibrium systems, including those that regulate mammalian behaviors. We then demonstrate that the predictions of this framework are in agreement with detailed analysis of spontaneous mouse behavior observed in a simple unchanging environment. Neural systems operate on a broad range of time scales, from milliseconds to hours. We analytically show that such a separation between time scales could lead to scale-invariant dynamics without any fine tuning of parameters or other model-specific constraints. Our analyses reveal that the specifics of the distribution of resources or competition among several tasks are not essential for the expression of scale-free dynamics. Rather, we show that scale invariance observed in the dynamics of behavior can arise from the dynamics intrinsic to the brain.