You can install up to 16 GBs.
Maximum Memory 16 GB (Actual) 8 GB (Apple) Memory Slots 2 - 204-pin PC-10600 (1333 MHz) DDR3 SO-DIMM
RAM should be installed in pairs. That would be two 8 GB modules; one in each slot.
About OS X Memory Management and Usage
Understanding top output in the Terminal
The amount of available RAM for applications is the sum of Free RAM and Inactive RAM. This will change as applications are opened and closed or change from active to inactive status. The Swap figure represents an estimate of the total amount of swap space required for VM if used, but does not necessarily indicate the actual size of the existing swap file. If you are really in need of more RAM that would be indicated by how frequently the system uses VM. If you open the Terminal and run the top command at the prompt you will find information reported on Pageins () and Pageouts (). Pageouts () is the important figure. If the value in the parentheses is 0 (zero) then OS X is not making instantaneous use of VM which means you have adequate physical RAM for the system with the applications you have loaded. If the figure in parentheses is running positive and your hard drive is constantly being used (thrashing) then you need more physical RAM.
Adding RAM only makes it possible to run more programs concurrently. It doesn't speed up the computer nor make games run faster. What it can do is prevent the system from having to use disk-based VM when it runs out of RAM because you are trying to run too many applications concurrently or using applications that are extremely RAM dependent. It will improve the performance of applications that run mostly in RAM or when loading programs.
You can upgrade to 16GB of RAM. The advantage is that some applications that are RAM-intensive will run faster and you'll be able to run more memory-hungry apps concurrently. The only downside that I've experienced is that you'll probably never use that full 16GB - I've only gotten up to about 14GB+ in real time use.
Go to the Crucial website and download the system scanner under the System Scanner tab. The site will report the upgrade paths and RAM modules that are right for your machine - yours, like my 15" late 2011, will use two sticks of 8GB 204-pin PC-10600 (1333 MHz) DDR3 SO-DIMM.
Good luck - 4GB just isn't 'enough' to me. 8GB is the sweet spot and 16GB is the most your model can handle.
Thanks for your reply.
But do you think it will fix the root cause -
"Many times it hangs when i switch from one application to another. Then i have to do a hard power off (by pushing and holding the power button). This happens even when i am just using 2 or 3 applications like mail, safari etc."
If this is the solution I will right away do an upgrade to 16 GB.
I doubt that upgrading your RAM would fix that problem - there may be an OS X problem or a hardware problem. Take a look at ds store's article - Step by step to fix your Mac - and see if you find anything applicable by following the steps in order.