The person who built our refrigerator cabinet box only left 1" for ventilation at the top of the refrigerator. Is this enough space for proper ventilation? There is a 1" gap on either side, and a 4" gap in the back (due to a narrow heating duct going up the wall behind it).
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.
You need to consult the manufacturer instructions. That is the only place to get accurate info for things such as clearances, etc.
In my experience, if this is a typical residential refer, 1" on top is pretty small. The sides do not need any clearance at all. Some units need no clearance at all. I mean like Sub-Zero, etc.
The sides certainly do need some clearance especially considering some now have vents on the sides also. I would say minimum 1/2 inch to each side. Plus, freestanding fridges are hardly ever completely plumb. Take a level to the side of one and see for yourself. Due to the plastic material and the spray insulation used in the body the sides can be bowed out causing fit issues. Never allow your contractor/kitchen designer to give you a 36" wide opening for a 36" inch refrigerator (most of which are between 35.75 and 36"). The built-in look is nice, but you are asking for trouble and built-in Sub Zeros, etc. are not designed the same as freestanding refrigerators. Minimum 37" opening to allow for ease of installation, proper ventilation and increased options when your fridge dies, often prematurely. It will still look good because there will be an even dark gap from the shadow on either side.