To lose weight riding your exercise bike you should ride it for at least 60 minutes per day.
You need to ride the exercise bike enough to work up a sweat. You don't have to ride the exercise bike for 60 minutes straight though you can ride for awhile then ride it again later.
The longest I've lasted on my exercise bike in one go was 15 minutes and I was sweating and tired and had to take a break.
I ride my exercise bike at least 15 minutes per day just to help keep weight off. I don't have time to ride the exercise bike more because of work.
But I do walk most places I need to go.