This excerpt can be found in Act I, Scene 1 of Hamlet. Marcellus says that when Christmastime nears, cocks crow all night long, and during that time, evil spirits do not haunt the earth, because it is such a sacred time:
And then, they say, no spirit dare stir abroad,
The nights are wholesome, then no planets strike,
No fairy takes, nor witch hath power to charm,
So hallow'd and so gracious is the time.
This statement comes in the context of the sentries' encounter with the ghost of King Hamlet. The ghost vanished with the crowing of the rooster, and the coming of the dawn, and Horatio says that he has heard this is a frequent characteristic of ghosts. Marcellus agrees, and tells the story about Christmas to support Horatio's theory.