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.
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.