Use a validation rule on the attribute “Maximum length”
Additionally, a limit on input field isn’t really limitation, since storage of a longer value is still possible. Therefor a validation rule would be a better solution
Validation => Custom validation
value limit:
$value < whatYouWantToBeTheMaximum