It is true that a gene is either being expressed, or not being expressed. However, the degree to which a gene is expressed can vary tremendously. "Degree of expression" basically means the number of times the gene is read by the transcription machinery, which (generally) correlates to the number of copies of mRNA present in the cell, which (generally) correlates with the number of protein molecules being translated. Essentially, the degree of expression of a gene corresponds to how much of the gene's product is being produced. (Of course, this being biology, things aren't always quite as simple as that, but this is the general trend.)
Here's an example. All nucleated cells express housekeeping genes that are required for the normal function of the cells. These are often involved in maintaining metabolism in the cell, sensing and processing nutrients, maintaining the cell's structure and shape, etc. These genes are expressed to a very high degree, meaning they are always "on" and being transcribed. On the other hand, there are many many genes that are not needed in "normal" situations, and are only turned on at certain points in development, during pathology, during a certain point of the cell cycle, or other similar situations. These genes have a very low degree of expression, and in fact may be turned off altogether in some cells.
So, the degree of expression can be described as the rate at which the gene is being transcribed. In a study like the one illustrated in your question, the number of copies of each gene's mRNA in the cell is quantitated, and compared to the expression of a housekeeping gene that should have the same degree of expression regardless of the sample. The relative amounts of each mRNA are then compared among individuals, and scored accordingly. This numerical score is then turned into a color for the purposes of generating the heatmap image.