From OdaWiki

screenshot [filename]

This command will take a screenshot of whatever is on screen at the moment and save it as the specified file in PCX format. If no file is specified, the name DOOMxxxx.PCX is used, where xxxx is the next available number (0000 to 9999, a file that does not yet exist). If it is used from the console, it will take a screenshot of the console.

You can take a screenshot while playing by pressing the key combination: CTRL+Print Screen or CTRL+SysRq