If it is not physically possible for the name class to have a length greater than ten (I.E: it represents some specific, documented naming standard which specifies all names must be less than ten characters) then this would go inside class X. It would enforce strict requirements in the setter for the name, as well as in the constructor. In fact, in this case, you should probably be making a specific class for the name property and encapsulating the login in there (much like you would a phone number class, or a ISBN class).
If however, this is simply a requirement necessitated by external influence and not really chosen for a specific design purpose (Say, the GUI does not have space for names longer than ten characters, a legacy database stores names in VARCHAR(10) or similar) then you would not put the logic in X. The class X will still support names longer than ten characters, but the classes that need a ten character name will need to perform appropriate transformations. (i.e.: the GUI could truncate it, insert a dash and move the rest to a newline, the database could maintain a separate map from unique 10 character 'id' values to true names.