Nigger is a vile racist term for Black people. The word has come to be seen as grossly insulting and humiliating. Niger (with one g) is actually the Latin word for black, and from the same word comes the verb "denigrate" (which ironically is what the base form does to black people, though racists don't appear to see this obvious connection).
It's a Neocon word in the United States though British racists use the word as well. For centuries members of the Ku Klux Klan, slave owners and other Racists have used the word in bad ways. Ordinary people don’t generally use the word except to show how bad prejudice is.
When is it acceptable?
Mainly racists use the word although most Blacks call one another and even other non-Blacks the N-word without using the word in a humiliating way. Use of the N-word is complicated, different English speaking nations and different subcultures use the word differently. It'd hardly ever good for white people to use the word.  Black people have more Freedom to use the term than White people since black people are unlikely to be racist against fellow blacks. There are just a few blacks prejudiced against their own people.
People who don't understand the black culture very well probably don't know how to use the N-word without causing offense and should be very careful how they use it if they use it at all.