It depends on exactly how you would like to limit the length of the text. It sounds like you want to limit the text to how much fits in the control visually. You can specify a maximum number of characters using the MaxLength property. That's the simplest solution, but may not work exactly the way you want.
If you want to limit the input by how much text the control can hold visually, you can handle the TextChanged event and see if the new text fits in the text box. If not, revert to the previous text. In order to see whether the new text fits, you would want to use a Graphics object (PSA: Please allocate and dispose responsibly) and call the MeasureString function (you may need to specify a StringFormat or some other info if the measurements don't seem right). When trying to change the textbox behavior like this, it's often difficult to get the cursor to act in an intuitive way (you'll see what I mean if you try it).