In simple words we can say ...
Habitat is the environment in which an living organism live ...
where as
Environment is the living and non living things surrounding the living organism...
An organism's habitat refers to an ecological or environmental area inhabited by particular species of plants, animals, fungi, etc. It refers to an organism's natural environment. The term--environment refers to the biotic(living) and abiotic(non-living) factors in the surroundings of a population of organisms. Life has to adapt to specific environmental conditions. These include the amount of water, available food, sunlight duration, temperature, type of soil, etc. Life is dependent on these factors in the environment and life can also affect the environment which it lives in at the same time. Therefore, the environment is not static, but ever-changing.