Depending on how much coffee is used and how it's applied, coffee may give hair a darker hue temporarily. The color change will fade after hair has been shampooed or if hair makes vigorous contact with another material, such as being rubbed with a towel or pressed against a pillow.
Coffee is used to darken hair as a temporary experiment, but a long-term color change is unlikely. Coffee is not acidic enough to penetrate the hair cuticle and coat the hair with long-lasting color, nor does coffee have the chemical properties that would enable it to penetrate the cortex.
For dye to color hair permanently, it must penetrate both the cuticle and cortex of the hair, strip away the existing pigment and replace the pigment with a new color. If the dye penetrates only the cuticle, then the color is considered semi-permanent; the color fades in about six to eight shampoos.