Upstream means towards 5' direction from the reference point (conversely for downstream). Reference point can be a single position such as transcription start site (TSS) or a bigger segment such as a gene. When we say upstream of a gene, it means some region of DNA that is towards 5' direction from the TSS of the reference gene. Downstream of a gene refers to the region 3' to the transcription termination site of the reference gene.