I know that "Negro" used to be the way that black leadership referred to their people. Dr. King referred to black people as "Negro." But at some point since, the word became a racially insensitive anachronism.
Is there any indication of when or why?
I don't know very much about this particular topic, but I can tell you that in the 2010 Census, when asking about race, the form clearly says "Black, African Am., or Negro".
I worked on the census and part of the training was about that particular phrase. It's on there because some blacks, especially older blacks, when asked about their race will refer to themselves as negro.
That said, google has an n-gram tool you can check out. It's a linguistic tool that will search a corpus (large pile of words taken from language) and compare your phrase to the pile. In writing, from 1800 to 2000, you can see that the word "negro" spikes around 1860 (Civil War) then again in 1940 (WWII) and again in 1960 (Civil Rights movement), while the phrase "African American" doesn't show up until the late '80s. I included the term "black people" as well and it doesn't register at all until the 60's. The problem with the n-gram tool is that it doesn't differentiate between "blacks" as referring to people - "The blacks in the 60's were strong" vs. say, a team - "The Blacks in the 60's were strong," - or colors - "The blacks in this painting are strong." Therefore, one has to be very careful about which phrases to use (hence, why I didn't even both searching for "colored") and to not draw too large of conclusions. Another thing to remember is that this is for written work, not spoken. I included the term "nigger" as well, and you can see that it also shows up around 1860, but never really rises higher than there - while people might use the word amongst themselves or even yell it out at people, few would actually write it in a newspaper or book that would be included in a corpus of written work. There are some very gentle increases from the 20's to the end of the 40's and again in the 60's, during times of social upheaval, but outside of the editorial pages of newspapers in the South, it would be rare to find such a blatantly racist term in print.
All that said, it appears that "negro" hit it's peak in 1968 and fell out of use by the mid 80's, and "African American" replaced it around then. The term "black people" showed a small bump in the 60's, indicating that "black", to refer to people, probably came into more common usage around then as well.
Here is the n-gram I created using the terms "negro, african american, black people, nigger."
"Negro" fell out of common usage largely as a result of the black power movement in the late 60's and early 70's. Part of that general trend was black people beginning to see themselves as a people as opposed to a race, if that makes any sense. Groups like the Black Panthers and people like Malcolm X made a point of saying that black people have a history and culture that is their own, and that they do not need to be defined by the terms and conditions of white society and a white controlled power structure.
For example here's Malcolm X
The worst trick of all is when he names us Negro and calls us Negro. And when we call ourselves that, we end up tricking ourselves. My brother Cassius [Clay] was on the screen the other night talking with Les Crane about the word Negro. I wish he wouldn't have gone so fast, because he was in a position to have done a very good job. But he was right in saying that we're not Negroes, and have never been, until we were brought here and made into that. We were scientifically produced by the white man. Whenever you see somebody who calls himself a Negro, he's a product of Western civilization —not only Western civilization, but Western crime. The Negro, as he is called or calls himself in the West, is the best evidence that can be used against Western civilization today. [Applause]
One of the main reasons we are called Negro is so we won't know who we really are. And when you call yourself that, you don't know who you really are. You don't know what you are, you don't know where you came from, you don't know what is yours. As long as you call yourself a Negro, nothing is yours. No languages—you can't lay claim to any language, not even English; you mess it up. You can't lay claim to any name, any type of name, that will identify you as something that you should be. You can't lay claim to any culture as long as you use the word Negro to identify yourself. It attaches you to nothing. It doesn't even identify your color.
If you talk about one of them, they call themselves white, don't they? Or they might call someone else Puerto Rican to identify them. Mind you how they do this. When they call him a Puerto Rican, they're giving him a better name. Because there is a place called Puerto Rico, you know. It at least lets you know where he came from. So they'll say whites, Puerto Ricans, and Negroes. Pick up on that. That's a drag, brothers. [Laughter] White is legitimate. It means that's what color they are. Puerto Rican tells you that they're something else, came from somewhere else, but they're here now. Negro doesn't tell you anything. I mean nothing, absolutely nothing. What do you identify it with? Tell me. Nothing. What do you attach it to, what do you attach to it? Nothing. It's completely in the middle of nowhere. And when you call yourself that, that's where you are—right in the middle of nowhere. It doesn't give you a language, because there is no such thing as a Negro language. It doesn't give you a country, because there is no such thing as a Negro country. It doesn't give you a culture—there is no such thing as a Negro culture, it doesn't exist. The land doesn't exist, the culture doesn't exist, the language doesn't exist, and the man doesn't exist. They take you out of existence by calling you a Negro. And you can walk around in front of them all day long and they act like they don't even see you. Because you made yourself nonexistent. [Applause] It's a person who has no history; and by having no history, he has no culture.
As a follow up question, what about the term "colored"
I find Kyle Ward's book History in the Making an insightful resource for this type of question. This book is largely made of excerpts from historical textbooks, and allows you to see how the presentation of certain topics changed through time. While the phrasing used in textbooks certainly won't exactly mirror common parlance, I think it still serves a purpose in answering this question.
In his chapter on Slavery in America, Ward includes excerpts from 9 textbooks, published between 1851 and 1995. As Ward states in this chapter, "Most of the textbook selections reflect the sharp racial stereotypes of their time."
Reading this chapter, I find that the 1851 textbook unsurprisingly uses the term "Negro." The 1856 excerpt is a Southern rant on States' Rights, and thus only makes a veiled reference to "race." The 1889 excerpt talks a lot about "Negro Slavery," and the 1900 one actually only mentions "Slavery." The 1933 excerpt talks about "the negro of plantation days," and even the 1950 excerpt clearly uses "negro" for race. 1961 again only mentions "slaves," but by the 1974 they use the term "blacks." Finally, the 1995 excerpt sticks to "African Americans."