How much ventilation space does a refrigerator need?
This entirely depends on the refrigerator and where the coils and fans are.
Older refrigerators were cooled with fins on the back, and depended on convection (heat rising).  The heat of the coils would draw air through the lower grille, up the back, and over the top.  A modern unit might do all it's cooling with a fan pushing heat out at the front bottom plate.

Samsung's current models require 1" on top, half inch each side.  See : http://www.samsung.com/us/support/faq/FAQ00021650/21818/Y/RB197ABPN/XAA

Keep in mind your cabinet is now built to fit just one size refrigerator: just hope that size is available in fifteen years when your current model is no longer repairable due to planned obsolescence.  Front venting units are also somewhat less efficient, all other factors held constant.

It's common to have the cabinet above the fridge a bit less deep than the others, to allow for airflow.