The short answer is:
VLANs 1-1005 are stores in valn.dat file stored in FLASH
VLANs 1006-4094 are stored in running-config and moved to starup-config after configuration is saved.
The full story is a bit more complicated and involves VTP as well. Here are details.
VLAN or VTP configuration changes in CatOS are written to NVRAM immediately after a change is made. In contrast, Cisco IOS software does not save configuration changes to NVRAM unless you issue the copy run start command.
VTP client and server systems require VTP updates from other VTP servers to be immediately saved in NVRAM without user intervention. The VTP update requirements are met by the default CatOS operation, but the Cisco IOS software update model requires an alternative update operation. For this, a VLAN database was introduced to Cisco IOS software for Catalyst switches as a method to immediately save VTP updates for VTP clients and servers. This VLAN database is in the form of a separate file in NVRAM called the vlan.dat file.
During boot up, the switch compares the content in the vlan.dat file and the configuration in startup-config to determine if it should use the configuration in vlan.dat or startup-config. When you save VTP mode, domain name, and VLAN configurations in the switch startup configuration file and reboot the switch, the VTP and VLAN configurations are selected by these conditions:
Tip: To remove all configuration including VLAN database use write erase command