On a chromosome, genes are arranged in a linear fashion along the chromosome, but chromosomes only line up into homologous pairs during cell division. During mitosis (typical cell division), chromosomes line up through the action of organizational centers called centrioles.
A chromosome is technically a linear strand of DNA. However, this DNA is tightly coiled into structures called nucleosomes by special protein complexes called histones and further condensed during cell division. As a result, the DNA is coiled and bent over many times, and a gene's location along the condensed chromosome may not reflect its exact location along the chromosome when unspooled. The scaffolding that forms the chromosome's backbone and histones that the DNA wraps around are consistent between chromosomes, so homologous genes line up exactly in paired chromosomes.