Where in the knee do you get the pain? Cleats are the most common reason, but there are other causes due to patella tracking or sheer forces which can be affected by saddle position and crank length.
In some cases, lateral displacement of the knee can cause pain, although for many that sort of movement is entirely natural and pain free.
Also consider what your foot and ankle are doing when you ride, you could be suffering excessive dorsiflexion
There's quite a range of what we do with our ankles when we pedal. Toes can point up or down and the range of ankle movement between the top and bottom of the stroke can range from -10° to +30°. ‘Normal’ ankle behaviour would be to undergo a small amount of dorsiflexion as the power is applied, followed by approx. 20° of plantarflexion as the leg is fully extended.
High levels of ankle dorsiflexion can cause large knee displacements, usually when the cranks are approximately horizontal and loads are at their highest. Under high efforts, the heel may also stay low around the bottom of the stroke, stretching the hamstrings and calf muscles that attach behind the knee.
Sometimes, this excessive dorsiflexion is due to collapsed arches and so insoles with arch support can help that too.
One of the less common reasons is vertical offset, but I'm only really familiar with that for very skinny riders where the combined width of the BB, cranks and pedals and spindles means the angle between their legs varies proportionately more between the top and bottom of the pedal stroke than with someone of a normal build. It's not very common, but interesting to consider.
As Alec says, tho, the first and most common reason is cleat misalignment, but just bear in mind that it's not the be all and end all. If you're still getting pain after you're sure the cleats are right, then consider some of these other possible reasons.
When a passenger of the foot, hooves in sight, tootel the horn trumpet melodiously