Each BIP (Bitcoin Improvement Proposal) has a assigned number. For example BIP-2, BIP-42 and BIP-152. How does this number get assigned and by whom?
The current BIP process is defined in BIP-2. An author drafting a new BIP leaves the BIP number in the preamble marked as XXXX. A BIP editor assigns a number to that BIP when the draft phase is complete. The number is chosen by the BIP editor, while generally one of the next higher numbers is assigned. Some number ranges might be reserved to allow BIPs with a common theme to have similar numbers. The current BIP editor is Luke Dashjr.