We have visited both Oslo and Bergen. Tiggrrr is correct - if you only have a day you would have to fly - pity as the train journey has wonderful scenery.
We had two and half days in Bergen after doing the Norwegian Coastal Voyage which was more than enough time to see bergen itself - which is quite compact.
If you do go to Bergen it is worth taking the funicular railway to the top of Mount Floyen where you get fanstatic views over Bergen and the surrounding area - sea one way mountains the other. The outside fishmarket is worth a visit and they have plenty of snacks for sale and also Bryggen - the old wooden houses along the quay. Check out www.visitbergen.com
Oslo is interesting and probably has more to see but if you have been before Bergen could be an option depending on the cost of airfares and whether there are flights that fit your timings.