Billy is quite correct, each time you exceed max revs the engine is damaged.
This includes speedshifts ( upshifting without lifting off the gas) or downshifting too early ( the engine is forced to over rev ). The damage suffered is minimal when GPL is set to "Novice", getting increasingly dangerous as you move up to "PRO".
So, always lift your right foot at each gearchange, when accelerating up through the gearbox and check the rev counter during your practice laps when you downshift for a corner.
Some cars are also more fragile than others. I will leave you to work out which cars need careful treatment
Some simple rules for setting your gear ratios.
On any track when you are lapping on your own, the rev counter should be just below the red line at the end of the longest straight.
But ( something that I actually forgot in the 66 race!!) you have to allow for higher speeds when you are slipstreaming someone, because your car will attain a higher speed and your engine will rev faster too. So maybe 5th gear needs to be lengthened by a click ( or two?). Only testing will prove what you need to do.
Once you have your 5th ( or in some cases 6th gear ) set for the fastest part of the track you can adjust the other gears.
The second ratio that I set is 1st gear. Try a start with race fuel. Did the car bog down? or did the engine scream at the rev limit? Ideally you want a smooth acceleration without too much wheelspin and without hitting the rev limit immediately. It might mean that you need to shift into 2nd very quickly to avoid over revving.
Next spread the other ratios so that the engine is always giving max torque ( like Axel showed above). The only thing that I would add is that the gaps between the ratios can be slightly larger between 1st and 2nd, with each gap getting smaller as you move up to 5th. This is because the engine has to work harder at high speeds and slightly closer ratios will help keep things accelerating.
Some tracks ( like Le Sarthe ) are specials and you might set 5th gear extra long to avoid maxxing out the revs down Mulsanne, or Monaco where you might want to set special ratios to better suit those tight corners.