Foreigners from the United States, Australia, the EU, and many other countries who intend to stay in Indonesia for less than 30 days can obtain a Visa on Arrival when arriving at Indonesia's international airports. These visas cost US$35, and a passport valid for at least 6 months beyond the 30 day stay. These VOA are extendable for one-time only, for an additional 30 days, at immigration offices in major Indonesian cities.
For foreigners planning to stay in Indonesia for longer than 30 days, they can obtain a tourist visa prior to arrival from an Indonesian consulate abroad, which is valid for 60 days. With this 60 day tourist visa, foreigners do not have to visit an immigration office while in Indonesia. It costs $45, two passport photos, proof of an onward/return ticket, and a passport valid for at least 6 months beyond the 60 day stay. To apply for a 60 day tourist visa, you must visit an Indonesian consulate in person or mail your passport, application, photos, money, and itinerary to the consulate in your home jurisdiction. It usually takes 5 business days to process the visa, but it is advisable to leave more time than that prior to your trip because of many unforeseen problems that arise during this process. Some consulates require payment in cash; others require payment in money order. The Los Angeles consulate requires an online application prior to arriving at the consulate, while the San Francisco consulate requires a paper application.
Indonesian consulates in the US are located in Los Angeles, San Francisco, New York, Houston, Chicago, and Washington DC (embassy). They keep very particular hours (usually open only in the morning for visa processing) and are closed on both US and Indonesian national holidays. Once a visa is issued, you must enter Indonesia within 90 days. All visas require at least two blank passport pages. Indonesian immigration officials are very strict about this and will not issue a visa in the last "amendment" pages of a passport.
For foreigners staying in Indonesia for longer than 60 days for educational purposes, it is possible to obtain a Social-Cultural visa (visa sosial-budaya) through an Indonesian sponsor. These are initially issued for 60 days but can be extended, one month at a time, for up to 6 additional months (8 months total).
For more on the types of Indonesian visas available and how to obtain them, check out this page.
For more on United States citizens entering Indonesia: check out this US Embassy site.
For foreigners doing long-term (up to 2 years) research in Indonesia, check out this page for research visa procedures.
Foreigners overstaying their visa will be charged at least Rp200.000 per day and can be subject to detention or deportation. Attempting to stay beyond the permitted visa days is not encouraged, as immigration officials are very strict about this and will not be kind to foreigners. Tourists wishing to travel in Indonesia for longer than 60 days can go to Singapore or Malaysia to renew their tourist visa, either at the Indonesian consulates in Singapore or Kuala Lumpur or through a visa agent in those cities. Visas on Arrival are not issued at the land-border crossings with Malaysia.