I have a business trip to San Francisco at March. Later, I am planing a few days off and visit Yosemite National Park.
How many days do I need minimum? Does it make sense to visit there for 2 days?
Yes, it makes sense even to spend two days in park if you don't do much hiking (and if you do, you can spend even more - there are a few hikes which will take a good part of a day).
First, the drive to Yosemite is long - it is 200+ miles away from San Francisco, and you'd drive through busy traffic of Easy Bay, so you would likely take about 4-5 hours only to get there with a stop on the way (at least to refill the tank). There is less traffic in winter, but conditions are worse too.
Then going through Yosemite isn't a fast-paced activity - inside the valley you usually just leave a car on a parking lot and use a shuttle. Those come once in a while, and on busy days some stops (i.e. Happy Isles) have a long line and you might not get into the shuttle right away and 30+ minute waits are common.
Several great waterfalls (Vernan, Nevada) also require a hike to see them, and they could be quite tiring depending on your experience. Even Bridal fall requires a short hike.
There are also some further points where you can drive - Glacier Point, for example (not going to be open in March though). But its around 30 minute drive by itself - and more if you have to follow up an RV.
Staying in Yosemite is also not easy, as there are very few hotels and they are usually booked well in advance - although you may get lucky on a weekday. Nearby Oakdale, Maricopa and Groveland have more hotels, but they are still 1+hr away from the park itself.
Finally if you consider doing this in March (especially early March), the Valley will likely be snowy, and a number of roads will still be closed. Depending on snow level some roads stay closed as late as June there. Check the website for road closures, expect to drive on snow, and very likely with chains.