What effect does upgrading RAM or the Processor have on the performance of a computer? I am considering buying a macbook pro and have the budget to upgrade either the RAM to 16 gb or get the faster processor, but not both. So I wonder: In what sort of tasks is the performance improved if I upgrade RAM vs. if I upgrade the processor?

Ps: My only really heavy weight application which I use is Lightroom and sometimes Photoshop
You should definitely upgrade your RAM.

The performance improvement of replacing your CPU is minor, and will only be seen while running tasks that require consistent processing, which most modern uses do not.

You can check for yourself how many times your CPU reaches 100% of its usage.

Upgrading your RAM will enable your computer to cache more stuff, hence run a lot faster, and in addition, you will be able to hold much more programs running while still not getting any significant slowdown.