The visa situation in Bali is extremely simple if you are only visiting for a short period of time. When you arrive in the airport in Denpasar, you will go through immigration and be issued a 30 day tourist visa for $30. This allows you to stay in Bali for up to 30 days. If you want to stay for over 30 days, you have a few options.
The first option would be to go to the nearest Indonesian embassy and apply for a 60 day social visa. To do this you will need to contact a travel company in Bali and get a sponsorship letter. This is fairly easy, and you can search for companies online who will give you a letter for a fee of around $35. Once you have the letter you have to take it to the Indonesian embassy, fill out an application, and bring your passport and a passport photo, after which they will decide if they will issue you the visa or not. It then takes about 1-3 weeks for them to make the visa and put it inside your passport (they will have your passport during this time). The cost is $45 per visa. I would only suggest getting this if you are going to stay exactly between 1 and 2 months in Bali. You used to have to get a social visa if you were going to stay in Bali over one month, but now you can extend a tourist visa as well as a social visa, which brings me to your next option.
The second option is to extend your tourist/social visa while in Bali. There are a few misconstrued facts about how exactly you can get this done, but generally I have heard that you have to give it to someone to extend for you. You can usually go through visa companies in Bali (ask around and youll find one), or through a private person who will do it for you. This costs 600-700,000 rupiah for each month you extend, and requires you to physically give your passport to a stranger for the time it takes to extend. This was probably the hardest thing I did in Bali, but you just have to do it. It is important to keep color copies of your passport with you at all times for this reason. It generally takes 1-2 weeks to get a visa extended, and you have to submit the request no later than a week before the visa will expire. I have also heard that you can go to the immigration office and wait in line and extend the visa yourself, but I was not able to find out where the office was or exactly how to do it. I figure its worth the money to get someone else to do it for you so you avoid the hassle of waiting in lines at an immigration potentially all day. But, I believe its only 200,000 rupiah if you can figure out how to go to the office and do it yourself, so if you can/want to attempt to do that then go for it.
If you are going to overstay your visa you can do it for a couple of days and pay a fine at the airport. The fine is 200,000 rupiah per day overstayed, so unless you are going to only overstay your visa for two days I would recommend just extending it since the cost is the same. Also, if you are pulled over or are required to show your visa during those couple of days that are expired, you could potentially get thrown in jail, so Im not sure if its really worth the risk. The best advice would be to plan your travel so you are in Bali for exactly under the time a visa is expired.