These get get saved to the Bioware Database, which is included in NWN2. They can be accessed via the SetCampaign* and GetCampaign* functions. This is a physical write to the hard drive, and can bog down servers if there are a lot of requests happening at once.
It is worth noting that variable names cannot be longer than 32 characters, or the setting of the variable will fail.
A good system for managing campaign variables is Knat's NBDE.