How To Set A Maximum Word Count On Post Titles
Adding the following snippet to your theme’s functions.php file, you will be able to set a maximum word count on post titles.
$title = $post->post_title;
if (str_word_count($title) >= 10 ) //set this to the maximum number of words
wp_die( __('Error: your post title is over the maximum word count.') );
Snippet Source/Credit: Pippin
Displaying WordPress Excerpt Dynamic Length