Have you looked at the Norway in a Nutshell tour? Sounds like it would suit you.
We went from Flam to Bergen by boat and it was amazing - such a beautiful journey. I'd highly recommend it.
There's basically nothing in Flam. I wouldn't stay overnight there unless your travel plans were such that you were arriving late and leaving early. It's a lovely little village, but it is just that! You can walk from there, so if hiking up the hills was on your agenda then maybe stay, but if not, I wouldn't use one of only a few nights there. Most people go there either to go on the Flam train, or arriving by cruise ship...
Bergen is lovely, but small. We probably had one night too many there. You should allow time to go up the big hill (I think it was a funicular that took you up) - there is LOADS of hiking to be done up there. I had no idea that there were miles and miles of walking trails. The views are stunning though, even if you don't walk. We then walked back down to the city which was nice.
The harbour area is a must do - but it's only small, so won't take long! There is a very good museum though (the Bryggen museum, IIRC) which is worth visiting - it's only small, so won't take long).
If you don't get a boat between Bergen and Flam, then definitely do a boat trip from Bergen - loads of trips to the fjords.
There's a lovely area called Nordnes, which is well worth a wander around. Full of lovely old, narrow streets. There's an aquarium there (we didn't go, but might be good if you're looking for something indoorsy to do?).
But 2 nights in Bergen would probably be enough (as long as you weren't arriving late afternoon 1 day and leaving early on day 3!). Make sure to eat from the fish market - lots of places selling the lovely fresh fish, cooked and served very simply, but totally delicious.