I am planning to stay around Osaka, Kyoto for 4 nights. Is it a good idea to stay 2 nights in each place or I should pick one as a base and move back and forth? I bought the Japan Rail Pass, so moving wouldn't be a problem.
Pick Kyoto as your base. It has far more sights of interest than Osaka, and it's easy to daytrip from there not just to Osaka, but to Nara as well.
The JRP is actually unnecessary for this, since there are lots of cheap local trains between the two, but might as well use it if you've got it. It will not be hugely helpful for getting around either city though, since it doesn't cover the subways or buses.
That depends, what is the purpose of your trip? If it's sightseeing, I would spend most of time in Kyoto. If it's about food, then I would spend more of my time in Osaka.
Personally, I was more interested in all the food so I stayed in Osaka (or more accurately in Kishiwada). To maximize my time in Kyoto, I left for Kyoto first thing one morning, stayed overnight at a Ryokan (highly recommended), and then spent the next day in Kyoto before finally taking the train back in the evening to Osaka.
As previous answers have stated, you don't need a JR pass. Local trains are fine.
Definitely it doesn't make sense to change hotel between Kyoto and Osaka.
Chose Osaka as your base.
Kyoto has definitely more touristic places to visit, but they are usually open until 17:00. While an evening in Kyoto Higashiyama area might be a nice experience, it does not necessarily need to be repeated every day. Nightlife in Osaka is definitely more lively.
You have to include commute time 45-60 minutes, but from Osaka you can get within the same time to different areas of Kyoto: Higashiyama (Gion), Arashiyama, Fushimi, Uji. Transport between these places within Kyoto would take similar amount of time and money*.
Osaka has much denser train and subway network which means you would be able to find a hotel closer to the station making it a more convenient base for going out.
Considering the weather, Osaka has more shopping galleries and underground passages connected with train stations. Should you encounter a day of heavy downfall or a typhoon, you can escape your hotel.
* JR Pass (either general one or only JR West) won't save you money between Osaka, Kyoto, and Nara. One-way fare is at most 600 yen and you would have to take bus or subway on Kyoto anyway, so try to arrange the JR Pass period for long-distance trips.