Display Name limit

Is there a way to limit the max characters for display name and username.  Thanks