The word guru means teacher in Hindi and Sanskrit but literally comes from the aksharas "gu" and "ru" where "gu" means darkness and "ru" means the act of removal so it is used for a teacher, someone who dispels darkness (ignorance) of the mind (person) and is a title of reverance used to address spiritual teachers or personal mentors in Hinduism. In this sense, guru is used more or less interchangeably with satguru (literally: teacher of truth). Compare also Swami.
The word has acquired a negative connotation in western countries, likely due to the prominence of several self-proclaimed "gurus" in the US during the 1960s and 1970s "New Age" movement (see e.g. Osho), who used Hindu terminology without having much else in common with mainstream Hinduism.
Guru is also the Sanskrit name of the planet Jupiter, which in vedic astrology is believed to exert teaching influences.
The term guru has since passed into wider metaphorical use. In hacker culture, Guru is an expert. Implies not only wizard but also a history of being a knowledge resource for others. Less often, used (with a qualifer) for other experts on other systems, as in VMS guru. (The definition is from Jargon file.)