Lucky, judging from the types of questions you are asking, you really need to get ahold of a basic HTML reference which could answer a lot of your questions.
One is available
here. And if you look up the
input tag, you will find that the maxlength attribute does exactly what you want.