It is advised to use the 3 second rule.
So in order to place a safe amount of distance between your car and the one in front, look for an object that is fixed i.e a road sign or a tree, and then count for three seconds in your head. If you reach the object before you have finished counting, you are too close.
When weather conditions are bad, or at night or also in heavy traffic the three second rule should be doubled so count to six as mentioned earlier. When the weather is really bad, or if in doubt, leave 9 seconds gap to be safe.
The problem with following too closely is twofold. Firstly, obviously there is a greater chance that you could crash into the car in front if, for some reason, they have to brake suddenly. Also, tailgating, as it is known, is often mistaken for road rage and could either frighten or anger the driver in front.
If someone is following you too closely, either move to another lane or pull off the road for a few minutes and allow the other car to pass you.