Here is an easy way to know you are the right distance from the vehicle in front of you when stopped at an intersection:
You should always be able to see the rear wheels of the vehicle in front of you. If you pull too closely you lose sight of the rear wheels and your vehicle is so close that you cannot maneuver out of the way if the car behind yours is going to hit your car. Also, if the person in front of you decides not to move when the light changes (turning left without a directional) you cannot pull out and around, if you did not leave enough space. With this simple method you can be sure that you are far enough back that you are not able to maneuver as needed.