does the CPU or the RAM affect the performance for PFsense?
<insert facetious answer>
I think the question you're actually asking is "how much CPU and RAM do you need not to be bottlenecked"...? Which itself is one of those "how long is a piece of string" questions, dependent mostly on how much bandwidth you're going to be using, how many individual connections, and what advanced features like IDS, VPN and encryption you're running.
As far as RAM goes, even 4GB is quite probably overkill - network appliances'll generally just shunt stuff out one NIC and forget about it, it's only resident things like IDS databases (snort or securicata for example) that you'll need to keep in memory. CPU-wise is a whole other story; generally speaking a low-power Atom will be fine for most deployments. I'm trialling a J1900 for mine and it barely breaks a sweat on the VPN - max throughput on that is only in the region of 1.5MB/s though.
If you take a gander at the pfsense
hardware page you can see that they rate their Atom-based stuff for routing at gigabit levels. These
Italian dudes have a more detailed rundown on what requirements you can expect from some of the features.
In a nutshell: yes, CPU and RAM matter, but generally if you chuck slightly more power than a pocket calculator at it you're liable to get good performance. If you've got a 100Mb/s or higher WAN, fifty hojillion users all using seven different VPNs through a captive portal then you'll likely need to consider more carefully.