excerpt_length
is only applied to generated excerpts— excerpts automatically generated from the post body.
To trim your manually created excerpt, use the same function that trims the generated one— wp_trim_words
.
if(has_excerpt()) {
$length = apply_filters('excerpt_length',20);
echo wp_trim_words(get_the_excerpt(),$length);
} else {
the_content();
}