See section 5.2 of PIC16F877A datasheet, its named Using Timer0 with an External Clock.
- - - Updated - - -
Also see Table 17-6 of PIC16F877A datasheet, it is named Timer0 and Timer1 External Clock Requeriments, parameters 40, 41 & 42. Here the period is in nanoseconds, convert it to Hertz. For 18F... do the same check.