There are two definitions for gene:
Genetic definition: A gene is a DNA segment specifying an hereditary character. For instance, a gene can specify blood type, or eye color, etc.
Molecular definition: A gene is the sum total of DNA sequences essential for the synthesis of a protein or a functional RNA (coding sequence + regulatory sequences).