It is the speech Macbeth gives in Act V, Scene 5, on learning that Lady Macbeth has died. In it, he describes life as something without meaning.
The scene goes like this: Macbeth, in Dunsinane, hears women crying out. Seyton returns and says: "The Queen, my lord, is dead." He answers: "She would have had to die sooner or later. Dead. There would have been a time for that word later on." And then he begins: "Tomorrow, and tomorrow, and tomorrow, / Creeps in this petty pace from day to day, / To the last syllable of recorded time."
He goes on: "Out, out, brief candle! Life's but a walking shadow, a poor player / That struts and frets his hour upon the stage," and closes with an image: "a tale / Told by an idiot, full of sound and fury, / Signifying nothing."
What he says about time and life comes from a man who, by this point, has the throne and has lost his wife, his friends, and the obedience of those who serve out of love. Shortly before, in Scene 3, he had already said that respect, love, obedience, and friends are "forbidden to me to desire."