An algorithm for counting to Graham’s Number
With only a polynomial amount of memory, a program that terminates can run for at most exponential time. This is because there are only exponentially many states (i.e. a combination of tape content (exponential), Turing machine state (constant) and position of the head over the tape (polynomial)). Thus any machine that runs for more than exponential time would have to visit some state more than once and hence loop.

In general, to get a program to run for $T(n)$ time you need $\Omega(\log(T(n)))$ memory.