After a period of a break, if you were sitting for long period the outward rotators of your hip along the buttock would be tight. Hence when you run with presure going along stiff foot and upwards the hip tightness also restricts good biomechanics. Hence your knee cap is possibly not tracking properly.
In cycling your foot does not hit the ground and there the effect of the hip is not seen.
How does you knee respond on going down stairs, usually that would hurt too.... if the problem is due to the knee cap issue...
It is hard to get to a diagnosis based on the limited information.
You would need an appointment to diagnose the exact issue and treat it.
Next Steps
You could try these general stretches:
knee to chest 10 sec hold 10 reps
knee opposite shoulder 10 sec hold 10 reps
Hamstring, quadriceps, piriformis stretches....
Health Tips
have a look at the shoe if the outer side of the heel is worn out....in that case if you have flat feet(arch is collapses) use a orthotic shoe insert after taking out the original insole.
These are some possibilities for your knee pain. But it is hard to diagnose, unless you make an appointment.