How to limit the length of a tag?
You want to use hook_form_alter for this to add custom validation to core forms

http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_form_alter/7

Create a form_alter_hook in your module and add a validation function to the taxonomy field in your form:

function yourmodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    if ($form_id == "&lt;your contenttype&gt;_node_form") {   
        $form['#validate'][]='yourmodule_taxonomy_length_check';
    }
}


Then just create a validation function to implement your logic, ex:

function yourmodule_taxonomy_length_check($form, &amp;$form_state) {
    if (strlen($form_state['values']['&lt;taxonomy_field_name&gt;']) &gt; &lt;your value&gt;) {
        form_set_error('&lt;taxonomy_field_name&gt;', 'Term is too long');
    }
}


For your taxonomy_field_name, you want to use the 'name' value of the taxonomy field in your target content type.