Japan's Immigration Control Act requires foreigners coming to Japan to have a valid passport and visa before arriving at one of the nation's air or seaports.
There are 62 countries that have standing visa waiver programs with Japan that allow foreigners to stay in Japan for up to between 2 weeks and 6 months depending upon nationality. A table of countries with visa exemption can be found here: http://www.mofa.go.jp/j_info/visit/visa/.
Japan provides seven different groupings of visas: Diplomatic, Official, Working, Temporary Visitor (employment is disallowed), Transit (employment is disallowed), General (for cultural activities, study, etc. – employment is disallowed), and Specified (spouse or child of permanent residents or Japanese nationals, long-term residents, or permanent residents). Additional details on each of the designations, including length of allowable stay in Japan per visa, can be found at the site above.
Japanese immigration provides short-term allowances for up to 90 days for activities that include vacation, business trips, job seekers, and other reasons that do not require the visitor to stay in Japan for any major length of time. Longer term stays such as for work or study in Japan or other reasons require a diplomatic, official, working, general, or specified visa.