Most Japanese people consider themselves both Buddhist and Shinto. At Christmas most of them turn Christian long enough for Santa to come and if Ramadan was more fun they would probably celebrate that too!
Despite the lack of deep religious feeling there are hundreds of thousands of shrines and temples in Japan and many of them are deeply revered.
Shrines refer to Shinto places of worship, Japans indigenous animist religion. You can tell that you are visiting a shrine by the 'tori' or ceremonial entranceway which is two vertical pillars with two crossbeams on top. These are often painted bright red.
Temples are Buddhist and they often have very large ceremonial gates with two fierce looking gods on either side to keep out evil. Temples usually have Buddhist statues inside.
Bear in mind that almost all temples have a small shrine attatched whilst shrines have a small temple, its not always clear where one ends and another begins.
Shrines will have a water trough by the entrance where you can purify yourself. Taking the ladle available pour some water into into your left hand to rinse it. Do this a little away from the water trough so as not to dirty the water. Then switch hands and pour some water into your right hand and take a sip, spit this out (use common sense about where to spit) and rinse your right hand. Replace the ladle.
This step is not essential, but does make you feel the part!
Walk up to the main building, toss a coin into the offering box (5 yen is perfect) and ring the bell by pulling on the ropes nearby to make the Gods notice you. Make two deep bows, clap your hands together twice, and then press your palms together to pray. Bow one more time and leave.
At a temple toss a coin into the offering box and press your palms together in prayer. There may be places to offer incense and candles for a small fee.