The majority of items in Team Fortress 2 have levels associated with them. Levels, viewed with the item name in the loadout menu, are purely cosmetic and do not modify the effectiveness of any weapon or item.
Originally, when the item drop system was first implemented in the Sniper vs. Spy Update, item levels were added by the developers to test if level functionality could be included. Dropped items were given a random level between 0 and 100, and the level would appear under the name of the item, visible to all players.
Random leveling is no longer a feature as of the May 29, 2009 Patch. All new items receive a standard level. However, hats will still receive random levels between 0 and 100 and this was later amended to levels 1 through 100 some time after the Classless Update. All existing items retained their levels. The ability to view levels in the in-game backpack for hats and misc items has since returned as of the August 18, 2011 Patch.
The Dueling Badges are the only items to change level. The Badge's level increases by 1 for every 10 duels won by the player. Once the Badge reaches a certain level (25, 50, 75), it will change into the next tier of badge, meaning that, for example, you cannot have a level 20 Silver Dueling Badge.
Botkiller weapons are assigned a level equal to the tour number that is completed when they are obtained.