Normally, the distance from Hanoi to Halong Bay is about 170 km. Shuttle Bus takes you around 3.5 hours, included haft-hour for break time from Hanoi to Halong Bay. If you go by private car, it takes around 3 hours.
On the other hand, there is another route which only takes you about 2.5 hours for travelling to Halong Bay. You can hire a car or buy a ticket of a VIP bus to travel from Hanoi city centre to Halong Bay through the new Hanoi - Hai Phong highway, which shortens the distance between Hanoi - Halong to about more than 150km.
However, there will be a fee for the new highway which is about 6.5 USD/turn/car and that is the reason why the price for transportation through this new route is a little bit higher than the old one.
Nowadays there are ports in 2 places: Halong and Hai Phong.
1- From Halong:
The distance from Halong to Hanoi airport is around 200 km. If you go by private car, it takes about 3.5 hours for direct transfer (by private car - price from $60 for 4 seats car).
One cheaper option is taking a shuttle bus from Halong to Bac Ninh (it's on the way back to Hanoi), then taking a taxi to the airport (about 20 USD). It will take about 4 hours.
Another option which is more expensive but take little travelling time is going through the new Hanoi - Hai Phong highway that shortens the distance to about 170km and takes about 2.5 hours. However as there is highway fee, a private car will cost about $70 for 4 seats car.
2- From Hai Phong:
There is a highway from Hai Phong to Hanoi. By taking this route, it will only take about 2 hours transfering directly to the airport. This option is available both with private car or using shuttle bus of some Halong cruises.