That is a simple question to solve.
First, let's consider the whole trip = 8 hours. If, between this 8 hours, we have x hours travelled by bicycle and y hours travelled on foot, we have:

Once:

So, we have:

Where x is the number of miles spent by bicycle.
Now, for y (number of miles spent walking) we have:

Now we can calculate the amount of time spent walking and on the bicycle as follows:

and,

So, the final answer is: Jim spent 5.5 hours on the bicycle.