No automatic sorting, you have to order them yourself.
I think I know what you’re getting at here… if you have categories collapsed, you can only drag a category to either the top of the categories list (when it creates some space above the top category), or nest it inside another category (when it shows a yellow highlight around the category name).
The trick for ordering categories is that you have to expand the category you want your new category to appear below, and drag the category over the last project in the list.