Manual:$wgExtraNamespaces

Details
$wgExtraNamespaces is used to configure additional, custom namespaces for a wiki. It can also be used to rename the default namespaces.

This is covered in detail on Manual:Using custom namespaces. Note that the first custom namespace should use the ID 100, as IDs from 0 to 99 are reserved (and negative IDs have a special meaning). The maximum namespace ID was 255 on some older (pre-1.5) MediaWiki versions, but 16-bit namespace numbers (-32768 through 32767) are supported in all current releases.

Example
To add a namespace with the name 'Foo' to your wiki you need to create 2 new namespaces (even number for the Foo page and odd number for its associated talk page):