This started out as a comment on the comment on @bummzack's answer, but grew too long.
how can I determine how many segments should I have
There are two approaches. The first is just the standard algorithm for rendering a Bézier curve: the control points form a bounding box of the curve, so if all of the control points are within epsilon of the line segment from start point to end point you approximate as a line; otherwise you subdivide using de Casteljau's algorithm. Epsilon is chosen according to the error you wish in the final result. (For rendering it's usually 0.5 pixels).
The other approach is a refinement of that using interval arithmetic. Take the length of the line from start to end as the lower bound, and the sum of the lengths of the lines through the control points as the upper bound. Again, subdivide as required by your final error requirements.
One normally subdivides at t=0.5, but de Casteljau's algorithm allows splitting at any point, so if you have a cubic Bézier with control points C_0 to C_3 and C_2 is much nearer the line segment between the endpoints than C_1 you might find that splitting at one of 1/3 or 2/3 gives tighter bounds. I haven't worked through the algebra to justify which would be better, but you can experiment and report back if you want. If nothing else, I wanted to point out that the option is there.