Answer:
It's called a weathervane (also wind vane). They are typically used as an architectural ornament on the highest point of a building. On a sailboat, the vane at the top of the mast is called a windex.
A device called an aerovane simultaneously measures wind speed and direction. Another tool is the wind sock used at airports. It points out the current wind direction and gives a broad estimate of the wind speed.
(see the related link)