An American idiom originally used to indicate that someone was being particularly fair or generous.
These days the expression is not generally used, as it is seen to be racist. When it is used, it may be a joke or a reference to race relations. It is now most frequently used as an article headline to let the reader know that the article will be about some sort of racism, and a talking point about the racial undertones of various words and idioms.
It is somewhat unclear what the phrase's origins are, but once it occurred to people that it could refer to skin color, it was used in such a way. The use of 'white' to mean 'morally good' was present in Old English, and presumably did not have racial overtones at that point. It was a common slang term in American English as early as 1877, used to mean 'honorable' or 'fair' (in both the South and the North). Phrases in the general form "it's very white of X" were common by the 1880s and on into the early 1900s. Whatever the origin of 'white' in this context, there was an obvious parallel with skin color, and at this point it is fair to say that the expression had racist overtones. It is generally held that this connection is not just obvious, but was also the origin and intent of the phrase.
These days it is likely to be used sarcastically, to the point where many informal forums give its definition as that of an insult. Urban Dictionary's first definition, for example, is "Used to describe someone who thinks they've done a great deed, charitable action or sacrifice, but in reality they've done very little to help the human condition."
There is a related phrase from the UK, 'Play the white man', which is also racist and falling out of use.