If alleles occur at the same locus on a chromosome, does that mean they are of the same size? I was under the impression that they were, but I saw a gel electrophoresis testing different alleles of the same gene and saw them separate. I don’t understand how they could separate if they are of the same size, but if they aren’t, then how can they be housed in the exact same locus?
Huntingtin is the causative gene of Huntington's disease. In people with Huntington's, a sequence of three nucleotides is repeated. The number of repeats varies, from a low of 9 in unaffected individuals, to more than 60 in severely affected ones. So depending on how many repeats you have, each of your Huntingtin alleles may have a different nucleotide size.
FMR1 is the causitive agent of Fragile X syndrome. Like Huntingtons, the gene varies in the number of trinucleotide repeats, but for FMR1, affected individuals can have over 1000 repeasts, meaning an extra 3 kilobases of genetic material versus the alleles of an unaffected individual.
Other genetic disorders are also related to the difference in allele size. You can have a deletion of a region of DNA (or an insertion) which is normally silent (recessive). The normal-length allele compensates for the defective allele, but the differently-sized disease allele is still present in the population, and counts as an allele of the gene.
It's not just disease-prone alleles which exhibit length polymorphism. A number of other genes will show variation on both the DNA and on the protein level. If the insertion/deletion is a multiple of three nucleotides and occurs in a loop region of the protein or on an intrinsically disordered domain, the insertion has a reasonable chance of minimal structural effect on the expressed protein. For one (completely arbitrary) example, PER3 has two major length variants in the population, with a 54 base pair difference between the two. Different populations have vastly different prevalence for each, with a range of 20-90% for the shorter version.
One thing to keep in mind is that "locus" points are just a human convention to help us map DNA. To the cell, DNA is just a single long molecule. (Or multiple molecules, for different chromosomes.) There isn't any labels for absolute position in the cell, so inserting or deleting a chunk of DNA mainly affects just the local environment. There isn't any sort of long-range indexing that gets messed up by the insertion.
One possibility of what you were looking at was a nuclease digestion experiment. A subject's gene sequence could be amplified from their DNA using PCR, giving a band of a certain size when electrophoresed on a gel. The PCR'd product could then be digested with another nuclease that specifically cuts one allelic variant, but not another. For example, check out this rather unrefined image I made:
Lane 1 is the molecular weight ladder. Lane 2 shows the PCR product of our gene of interest, which has two possible alleles - one that can be cut with our nuclease, and one that can't. The rest of the lanes show the result of incubating the PCR product from different individuals with our nuclease. Lane 3 shows a homozygote for one allele, the one that cannot be cut. Lane 4 shows a heterozygote, where the uncut 900 bp band is also seen with the cut 400 and 500 bp fragments. Lane 5 shows a homozygote carrying the cuttable allele on both chromosomes - there is no intact 900 bp band.