A roof is part of a building envelope. It is the covering on the uppermost part of a building or shelter which provides protection from animals and weather, notably rain or snow, but also heat, wind and sunlight. The word also denotes the framing or structure which supports that covering.
The characteristics of a roof are dependent upon the purpose of the building that it covers, the available roofing materials and the local traditions of construction and wider concepts of architectural design and practice and may also be governed by local or national legislation. In most countries a roof protects primarily against rain.
Source: Wikipedia – https://en.wikipedia.org/wiki/Roof