Limit characters field

Limit characters field

Can I limit the number of characters in a field? Maybe with a custom mask?