There are two reasons to use gaps.
•You can put gaps next to and under all the cells just because you think the heat map is more attractive that way. The gaps server as borders.
•Use gaps to group sets of rows and columns to give some structure to the heatmap. Maybe the left half is for one cell line, and the right half for another. Put a gap in between to distinguish them.