DNA is packaged into discrete units called chromosomes. The chromosomes come in pairs with one from the mother and one from the father. There does not seem to be any rhyme or reason to the number of chromosomes a species may have. For example, humans have 23 pairs, the other three great apes have 24 pairs, mice have 21 and horses have 32. It appears that during the course of evolution chromosomes can undergo fission and fusion or be lost altogether.
It is not necessary for two species to have the same number of chromosomes to produce fertile offspring. For example, Przewalski's wild horse has 33 pairs yet when crossed with a domesticated horse with 32, the offspring are fertile and can mate with other domesticated horses (Chandley AC, Short RV, Allen WR, J Reprod Fertil Suppl 23:356-70, 1975). What happens is that two of the chromosomal pairs from the wild horse fuse in a process called Robertsonian translocation. This can happen in humans as well and some people are walking around with 45 chromosomes.
The X and Y chromosomes determine sex. Females have two X chromosomes and males have an X and a Y. While female offspring will obtain an X chromosome from each of their parents, male offspring will always inherit their father's Y chromosome. So mutations in the Y chromosome will always get passed on and thus can accumulate. Jennifer Graves of the Australian National University, believes that the Y chromosome is rapidly shrinking and may disappear altogether. The basis of her claim is from comparing the genomes of various mammals. For example, she has found that kangaroos diverged from humans 180 million years ago and the platypus 210 million years ago. These mammals also have analogues to human sex chromosomes. In the last 300 million years the Y has lost most of its original genes. She estimates that the remaining genes have about 10 million more years to go. Hence to avoid extinction, humans may need to evolve into a new hominid species.
There is some dissent though. David Page of the Whitehead Institute has discovered 78 genes on the Y (about twice as much as previously believed) and there could be more. He also found palindromic sequences so there could be some redundency. The Y might be able to repair errors by taking hairpin configurations. So are we men on our last legs? I guess we'll have to wait to see.