To stay in shape and to lose weight or keep your heart healthy you should aim to ride your stationary exercise bike for 20 to 30 minutes each day.
I ride my exercise bike for 10 minutes each time over the course of the day 3 times per day to make a 30 minute bike ride.
I once tried riding the exercise bike for 30 minutes straight but I was way too tired after that and now can only last 10 minutes at a time.
But as long as you're doing at least 30 minutes per day you should lose weight, stay in shape and keep your heart healthy.
I also try to walk to places that I can instead of driving the car as that walking keeps me in shape and healthy as well.