The White House was first made white because a lime-based whitewash was used in 1798 when its walls were completed. The whitewash helped to protect the porous stone of the White House from freezing.
It is not explicitly known why the White House was later painted white, but it may well be that, as the whitewash faded, it began to look dirty.
The White House began as a nickname for the president's residence early in American history. In 1812, Congressman Bigelow wrote a letter to a colleague, referring to the fact that they call the president's mansion "the White House." In 1901, Theodore Roosevelt made the White House the official name of the president's house.