Suppose you get a flat 100m-1km (or some distance that you can sprint/run) from the finish line. Can you leave your bike and run the remaining distance to the finish line? Or are you required to carry your bike while running? Or are you required to cycle across the finish line (i.e. wait for a service car to come fix your bike)?
The rider may cross the finish line on foot, provided that has his bicycle with him.
Note that "his bicycle" may be a teammate's bike or a neutral service bike.
What constitutes a 'finish' will depend on the race organizing body and regulations and rules.
For the races organized under the Union Cyliste Internationale (UCI) rules, at least a partial answer can be found in the UCI Cycling Regulations, Part 1: General Organisation Of Cycling as a Sport:
1.2.100 The finish occurs at the instant that the tyre of the front wheel meets the vertical plane rising from the starting edge of the finishing line.
So, the bike has to cross the line. Doing a quick search I did not find anything in the general rules about how the rider may propel the bike (riding, pushing carrying etc).