I have crafted several hats recently, all of which don't contain any craft numbers but only states that it was crafted by me. Not even in the 20,000 range. So I was wondering, what number do craft numbers go up to and how do you actually obtain them?
As per the wiki, craft numbers apparently go into the thousands in some third-party backpack viewers and to get one visible in-game, you have to have crafted one of the first 100 of certain items or purchased one of the first 100 crafted because craft numbers above 100 do not appear in-game. I have yet to find a proper list of which items they apply to at this time, but it seems to apply to newer items.
Crafting numbers are a cosmetic value attached to any crafted weapon, misc. item, or hat introduced during the May 5, 2011 Patch, as well as most items added in any later update. This number represents the order that a given item was crafted in; for example, a "Brain Bucket #1" would be the very first Brain Bucket to have ever been crafted. While the craft number goes into the thousands on third-party backpack viewers, #100 is the maximum value displayed in-game. For example, a "Brain Bucket #101" would only appear in-game as "Brain Bucket".
It's tough to say exactly how high they can go, but since they are viewable into the thousands, beyond what is visible in-game, a fair guess would be based on the probable storage type for the number. Negative crafting numbers wouldn't make sense so it is likely unsigned. Since they go above 200,000, it's likely 32-bit which goes up to 4,294,967,295. There is always the possibility that someone arbitrarily capped it somewhere, but 4,294,967,295 seems fairly likely otherwise.
As skovacs said, only craft numbers between 1 and 100 will show up in game by name. In other words if someone is spectating you and it displays your hat, it will display the name Compatriot #100 but a Compatriot #101 will only appear in your backpack. I know if you use websites like backpack.tf, you can see what craft numbers your items are.
Additionally, not all items have craft numbers. For these items, it doesn't matter if you crafted the first or the 1837th, it's going to show up that same no matter what. You can see which items have (or don't have) craft numbers on the wiki.