Two individuals have a genetic relationship if one is the ancestor of the other, or if they share a common ancestor. In evolutionary theory, species who share an evolutionary ancestor are said to be of common descent. However, this concept of ancestry does not apply to some bacteria and other organisms capable of horizontal gene transfer.
Assuming that all ancestors are unrelated, an individual has 2n ancestors in the nth generation before him and about 2g+1 total ancestors in the g generations before him. In practise, however, it's clear that the vast majority of ancestors of humans (and indeed any other species) are somehow related (see Pedigree collapse). Consider n = 40: the human species is surely more than 40 generations old, yet the number 240 dwarfs the number of humans that have ever lived.
As far as contribution to one's autosomal DNA is concerned (this does not include Y-chromosomal DNA or mitochondrial DNA) assuming that none of one's ancestors had children with relatives (even distant relatives), an individual has a total of 2046 ancestors up to the 10th generation, 1024 of which are 10th-generation ancestors. With the same assumption, any given person has over a million 20th-generation ancestors (generally equivalent to around 500 years) and this theoretical number increases past the total population of the world at around 1400 AD.
Some cultures place great reverence on ancestors, both living and dead; contrastingly, people in more youth-oriented cultural contexts may display a lesser degree of veneration for elders. In other cultural contexts, some people seek providence from their deceased ancestors; this practice is sometimes known as ancestor worship or, more accurately, ancestor veneration.