The memory requirements do vary, but here are rough numbers that should be good starting points:
For HD, you want at least 2GB for each process; preferably more. For 2K or 4K stuff, give each process the maximum (4GB). Because After Effects is a 32-bit application, each process can only use up to 4GB. But you can use multiple processes for rendering for RAM preview and final output. (WacomPirate's answer is misleading in this regard.)
You almost always want to leave 1-2GB for other applications.
That leads to some relatively simple math to get you to a starting point. For your system, tell After Effects to only use 6 of your processors, and give each 2GB (or a little more) of RAM. For longer RAM previews, go ahead and give the foreground process its maximum amount of RAM by sliding the Longer RAM Previews / Faster Rendering slider all the way over.
But the caveats are endless. So this should be a starting point, and you can tweak and frob the controls for each job as needed. If you hit out-of-memory errors, then use fewer processors with more RAM for each. If you're working on tiny SD frames, you can use more cores with less RAM for each. And so on.
If you added more RAM, you could use six or seven of your processors with 4GB allocated to each. In this post, I basically say that cramming more RAM into your computer is the simplest way to improve performance with After Effects on a 64-bit operating system.
See these pages for details:
["Memory (RAM) usage and storage"](http://help.adobe.com/en_US/AfterEffects/9.0/WS9F936D13-E76A-41e4-BF8F-577132AB4723a.html)
["Memory & Multiprocessing preferences"](http://help.adobe.com/en_US/AfterEffects/9.0/WSDD65B476-971A-48e9-A5FD-D90E9A2B996E.html)
["RAM and disk caches"](http://help.adobe.com/en_US/AfterEffects/9.0/WS155A1BB2-BB32-4833-A079-F8396553D7B0a.html)
["Improve performance"](http://help.adobe.com/en_US/AfterEffects/9.0/WSF13D6BED-C53B-408a-B2D6-C8B4205D4FB7a.html)
Don’t think in terms of maxing out processors or maxing out RAM at all times. Think about how to get the most work done in the least time. Consider, for example, that it’s quite often your slow hard disk or memory bus that is the bottleneck, and the CPUs are twiddling their thumbs waiting for some other part of your system to catch up.