In contemporary Japan there is a hard distinction between shrines and temples. Shrines are shinto, and temples are buddhist. This distinction came about when the government "seperated" the buddhas and the kamis in the late 19th Century.
In my opinion it was a bit like trying to unscramble eggs, as for most of Japanese history the religious practises were a hybrid of various local cults mixed in with buddhism, daoism, confucianism, and other influences from Korea and even India.
All these photos are from 2 buddhist temples in Miyoshi, Hiroshima. The top photos shows a small Inari shrine. The second photo is intriguing, anbd I haven't been able to find out anything about the figure, but the gohei (wand with paper streamer) indicates this is a shinto shrine.
As buddhism was adopted by the ruling families in central Japan they used it to extend their control over the whole of Japan. As buddhism became more commonplace, temples were built next to shinto shrines so that the buddhist priests could pray for the kami and lead them to enlightenment. Later, shrines were built inside the grounds of the temples and the kami used to protect the temples. The first record of this latter type of shrine-temple was here in Miyoshi.