The fields within the forms you present to your website users determine what data you collect from them. Make the form too complicated, and no one will take the time to fill it out and you end up with a phenomenon named form abandonment. On the other hand, if the form isn't long enough to obtain your must-have information, you've missed an opportunity to gather important marketing data. It's crucial to strike a balance.
This poses problems because the right length cannot be distilled into a certain number of fields. (That would be too easy.) A better way of measuring the proper length of a web form is gauging the user's experience. If the user stands to benefit from a particular data field, it's perfectly fine to include it. In fact, you can let the form go on and on and on as long as the user is engaged and understands its benefit.
Also, make sure you aren't collecting data at random. If you don't have a call center or a sales team, don't ask for a phone number. Consider asking only for a ZIP Code, and omit the city and state fields.
Hopefully you had a good reason for coming up with the form idea in the first place. (Not every website has to have one.) Go down the list gradually from most important fields to lesser important fields, constantly questioning whether you've passed the threshold where the user no longer has incentive to cooperate. Follow that formula, and you'll take your best shot at solid data collection from your website form.