Under ideal driving conditions, you should maintain a following distance of at least:

To avoid driving too closely to the vehicle in front of you, use the two-second rule. When the vehicle in front of you passes a stationary object, begin counting. If the front of your vehicle reaches the stationary object before you finish counting to two, you are too close to the next vehicle.
DMV Writen Test