The longer you spend in the country, the more you will get out of it. As it is so vast, it would be easy to spend years there and not see all it has to offer. If you are planning a 2-3 week trip, it is probably best to stick to Bali as the island has more than enough to offer for that length of time. If you are staying around 4 weeks you would have time to also visit Lombok and the Gili Islands (or take a 5 day boat trip to the Komodo Islands and back). A minimum of 6 weeks is needed to see Java, Bali and Lombok and this will still be fairly rushed. The distance you need to cover is huge and Indonesian transport can be painfully slow at times. Try not to pack in too much into your schedule as you will spend several nights in commuter towns and won't have enough time to savor the attractions of the country. You can save a fair bit of time if you take the convenient, but more expensive, option of domestic flights around the country.
What time of year is best to go?
Depending on which area of the country you visit, the wet season runs from about October to April. However, in many areas it is often very difficult to tell the difference between the two seasons and your travel may be unaffected. If you were wanting to visit some of the more remote islands in the wet season, you may find it very difficult or impossible. Storms off the islands can be pretty violent and so boats do not run.In the dry season this is not an issue.
The peak tourist season runs from early July to mid-September and again around the Christmas period. In the more touristy areas (mainly Bali), rooms can be fully booked around these times so you may need to book ahead. Visiting in the dry season will mean better weather and more facilities/transport, but it will be more crowded. Due to the fall in tourism this isn't too much of a problem now, but will become increasingly so as tourism picks up.
Whats it like in rainy season? Do I need to bring anything extra?
The rainy season is fairly minor its impact (in most the country). If it does rain, it tends to be in a tropical downpour and then be dry and sunny for the rest of the day. In some areas of the country (e.g. Nusa Tenggara), the wet season is more pronounced and it has been known for rain storms to last for days! This is a rarity however, and for the majority of the country the rainy season is fairly un-noticeable and should affect you very little.