In bacteria and viruses, there is a linear relationship between the size of the genome (that is, the totality of DNA) and the number of genes. But when it comes to eukaryotes (animals, plants, fungi and a series of other organisms collectively known as protozoa and algae), this relationship doesn’t exist, nor does exist a relationship between any of them (genome size or number of genes) and the number of chromosomes.
In eukaryotes, most of the DNA doesn’t encode anything, and we are still understanding the functions — if any — of this DNA. Besides that, a chromosome is just an individual DNA molecule, and counting the number of chromosomes in a cell doesn’t provide any information about the size of the DNA or the number of genes it contains.
To illustrate this, the chart below shows the number of genes, the diploid number of chromosomes and the size of the genome (in Mbp, or mega base pairs) of some animals, fungi, plants and bacteria (bacteria have only 1 chromosome). Hover the bars to see the values. Click "show number of genes", "show genome size" and "show number of chromosomes" to change the values.
You can see that the width of the bars don’t change proportionally: an organism that was ranked high regarding the genome size now is ranked low regarding the number of genes, or an organism that was ranked high regarding the number of genes now is ranked low regarding the number of chromosomes.
After playing with the bars for a while, there is a better way to see this lack of relationship: a scatter plot.
In the following chart, the vertical axis represents the number of genes, and the horizontal axis the size of the genome (in Mbp, million base pairs). You can see that the organisms (the circles) don’t follow a pattern of dispersion. Hover to identify each organism. Click "Genome size vs Chromosomes", "Genes vs Chromosomes" and "Genome size vs Genes" to change the respective pair of variables.
Sources: Wikipedia, WolframAlpha, BioNumbers, National Center for Biotechnology Information. Created by Gerardo Furtado.