Always go for the most RAM you can get is all I'm gonna say. The difference between an i5 and i7 dual core won't be noticed, but the difference between 4 vs 8 vs 12 gb of RAM is huge.
Definitely aim for 8 gb minimum but I've been finding that 12 gb is optimal for me. Especially if you, like me, run Windows with lots of google chrome tabs/windows because both the operating system and the browser are such unoptimized resource hogs.
For the vast majority of casual users, the 12 GB of RAM is probably overkill. For example, I've got six programs open right now, and 12 internet tabs open, and I'm using 4.2 GB of RAM. I have 16 GB of RAM because I do lots of video editing and such, but I could easily get away with just 8. The type of RAM is also a variable, the newer DDR4 being faster than the older DDR3 (different RAM can also have different clock speeds, which affects performance) - but this is nitpicking and really doesn't have a huge affect.
But you'd definitely see more of a performance difference with the CPU as opposed to RAM, and the CPU is usually next to impossible to upgrade. RAM, as someone else pointed out, is extremely easy to upgrade. You want to upgrade from 4GB to 8GB? Add an extra 4GB stick; or remove the 4GB stick and add a 8GB stick.
The caveat: if you are on a 32-bit operating system, your system will not be able to utilize more than 4GB of RAM, so adding extra would be useless.
Another thing to point out is that it is important to look at the generation of the CPU. A newer generation i5 will outperform an older generation i7. When buying computers, always be sure to look up the CPU on
PassMark Software - CPU Benchmark Charts to compare the CPUs of the computers you are buying. As long as you have a computer with a SSD, and at least 8GB of RAM, your performance bottleneck will be with the CPU, so make sure to spend a little more money to get a good one.