The examples you listed are for item types, not IDs.
In general, IDs will be determined by the database - whereas item types will be static as you say.
A TCM URI consists of anywhere from 2 to 4 parts separated by a dash (listed in order):
- The ID of the Publication it belongs to. This is 0 if the item is not in a Publication (e.g. Users, Groups, Publication Targets, etc.)
- The ID of the item itself. This is typically an auto-increasing number.
- The item type of the item (Folder, Component, etc.) The possible values for this are fixed and will be the same for all items of that type. You can view the full list of item types by looking at the API documention for the ItemType enumeration (although add-on products occasionally introduce new ones that are not covered there). Components are the most common item type in the system and so typically do not include their item type (16) in the URI (but it's not a problem to do so).
- (Optional) The version of the item in question. Version 0 is the currently edited / checked out version and anything else refers to a specific version of the item. If this part is left out (most of the time), the URI is version-agnostic and the latest version is implied.
"Categories and Keywords" (as well as a few other entries in the CME) is not a real item -- it is only used for grouping entries within the Content Manager Explorer. Such entries will they have a non-standard URI (but they still have one for reference, navigation, etc.).
Here are the list of Content Manager item types as of Tridion 2013:
Publication = 1
Folder = 2
StructureGroup = 4
Schema = 8
Component = 16
ComponentTemplate = 32
Page = 64
PageTemplate = 128
TargetGroup = 256
Category = 512
Keyword = 1024
TemplateBuildingBlock = 2048
VirtualFolder = 8192
PublicationTarget = 65537
TargetType = 65538
TargetDestination = 65540
MultimediaType = 65544
User = 65552
Group = 65568
DirectoryService = 65664
DirectoryGroupMapping = 65792
MultipleOperations = 66048
MultipleOperations = 66048
PublishTransaction = 66560
WorkflowType = 67584
ApprovalStatus = 131073
ProcessDefinition = 131074
ProcessInstance = 131076
ProcessHistory = 131080
ActivityDefinition = 131088
ActivityInstance = 131104
ActivityHistory = 131136
WorkItem = 131200