W8JI has a great writeup on this topic. I'll summarize the key points.
Key clicks are generally undesired "clicks" or "thumps" generated by a CW transmitter as the key is put down or let up.
They can be caused several things. The most obvious is that a fast transition from carrier on to carrier off requires a wide bandwidth. You can think of this by considering that CW is a special case of AM with 100% modulation, where the baseband signal is a square wave. This square wave, theoretically unlimited in frequency, when multiplied with the carrier, will generate infinite sidebands.
Less obvious reasons arise from practical issues in transceiver construction. For example, a transceiver typically uses the same VCO for receive and transmit. When operating QSK and split, the VCO must change frequency with each change of the key. If the VCO does not settle fast enough, you get key clicks.
Modulating the carrier will always require some sideband power, so key clicks can't entirely be eliminated, but only reduced to an acceptable level.
W8JI's article says "The ARRL recommends a 5 mS [sic] rise and 5 mS fall time for CW, based on data in section 2.202 of FCC rules and CCIR Radio regulations." I don't care to dig into the original sources, but it sounds reasonable.
However, this is just a simple guideline. Just specifying the rise and fall times doesn't say much about the shape of the rise and the fall, which can have as much effect in the frequency domain as the rise and fall times. Remembering again that CW is a special case of AM, we'd want the rise and fall to be a sinusoidal envelope, since this limits the bandwidth maximally. Anything that's not sinusoidal will contain harmonics, which is exactly what we don't want.
So, how can this be implemented? You can filter the envelope (the on-off signal coming from the key), or you can filter the output. Filtering the envelope can be viewed as pulse shaping, a common technique among digital modulations.
The simplest approach would be to put a simple RC filter on the envelope, which is a little better than nothing. However, with a single-pole filter, you can get at best a 3dB/octave reduction in the harmonics of the envelope. Remember, we want ideally a sinusoidal envelope. A single-pole filter gets us closer, but not all that much, because although the harmonics from the rectangular envelope are attenuated, such a simple filter can't attenuate them very much.
We can make a better filter with more poles, giving us a steeper frequency roll-off, better attenuation of the harmonics, and thus a better approximation of our sinusoidal envelope, but this comes with increased cost. However, all radios come with what should be a pretty good filter: the receive filter. As it turns out, most radios send the transmitted signal through the same filter as is used for receive, since this is the most practical approach.
W8JI elaborates in his article that many transmitters use the SSB filter for this purpose, which is great, except that it's a lot wider than it needs to be. SSB filters are around 3 kHz wide, while just around 200 Hz would give us the ARRL recommended rise and fall times of 5 ms. He argues (and I tend to agree) that radios should be transmitting through their CW filter, instead of the SSB filter.