Header files contain function and variable definitions that are imported into C++ programs using the #include statement. Header files have a ".h" extension and declare functions and define macros. When a function is used in a C++ program, its definition must be imported from the library by including the appropriate header file. Common header files provide input/output operations (iostream.h), console input/output (conio.h), formatted I/O (iomanip.h), strings (string.h), mathematics functions (math.h), general purpose functions like memory management (stdlib.h), and random number generation (stdlib.h).