When you come to Japan, you would visit at least one temple or shrine. There are 76 thousands temples and 88 thousands shrines in Japan. Actually there are more temples and shrines than convenience stores whose number is around 50 thousand.
But what are the differences? First of all, shrine is for Shinto and temple is for Buddhism. Shinto is the oldest religion in Japan and relatively primitive. Its unique characteristic is polytheism believing in many gods and spirits. People believe there are as many as 8 million gods and spirits- people find gods and spirits everywhere, from behind a leave, under a stone, to top of a mountain.
Buddhism is originally from India and it is a religion to seek for ultimate salvation through hard trainings. It arrived in Japan via China and Korea early 6th century (When it arrived in Japan, it was already influenced by Confucianism and was not exactly the same with the original Indian Buddhism). It was initially a religion for rulers but became common among ordinary people during 11th to 12th century.
Buddhism has been the central religion in Japan since the beginning of its introduction, interestingly however, Japanese did not abandon Shinto. Both have coexisted and often mixed together for long time until late 19th century, when revolutionary government banned the mixture of two religions. Still today, you would find a shrine in a site with temple.