How can I disallow spaces in usernames?
The best way to handle this is to implement hook_form_FORM_ID_alter for the user sign up and edit forms and append your own validator to check for spaces in the username field.

As for the length of a username, the minimum is 1 character and the maximum is 60 - as per the db schema.