A niche is the totality of all biological and environmental factors that affect a population. It encompasses everything one can think of that allows populations to live, grow, and reproduce. It also changes with the needs of the organism.
A habitat is the specific place where something lives. Habitat is used to describe the particular ecosystem or areas that are suitable for the organism live in.