You can enable trading for outside of regular trading hours from within the Global Configuration of TWS.
Click on the Edit menu option and choose Global Configuration. On the left side, click the option for Presets. On the right side, the Presets section will load. The first section should be timing. Look out for the box that says "Allow order to be activated, or filled outside of regular trading hours (if available)".
Check this box, and select Apply and OK at the bottom of the screen. If you only want your oder to be eligible to activate during the pre-opened session and not after hours, you can check the box that says "Allow order to be routed and executed during pre-open session".
More information on how to trade stocks during the pre-market or post-market can be found in our Knowledge Base.