Determine suitable clock speed?
Unless you are power-constrained, make it as fast as possible.  The 16F877 is a old part and slow compared to many newer and cheaper parts available today.  Its top speed is 20 MHz clock, which results in 5 MHz instruction rate.  All 18F can go at least 2x as fast, and the 24H and 33F another 4x beyond that and manipulate 16 bit quantities per instruction.

If you need to save power, then the '877 make little sense, so if you're using the '877, then maxxing it out is a no-brainer.  Use a 20 MHz crystal and you're done.