People put on and take off their shoes in the genkan, or entranceway.
Japanese have developed the custom of eating meals sitting on tatami mats, not on chairs. They also roll out the futon on which they sleep on the tatami floor. Therefore, they take their shoes off when entering the house to avoid getting the floor dirty. The genkan - or the entranceway just inside the front door where shoes are removed - is slightly lower than the hallway and the rooms of the house.
Nearly all Japanese homes today have one or more Western-style rooms with wooden flooring or carpets. To prevent their socks from getting dirty and their feet from getting cold, most Japanese change into slippers after taking off their shoes. Slippers are not worn in rooms with tatami mats, however.