Files can store data permanently on storage devices like hard disks. There are three main classes in C++ for performing file input and output - ifstream for input, ofstream for output, and fstream for both input and output. These classes provide functions like open() and close() to manage file access. The insertion and extraction operators can be used with file streams similarly to cin and cout to read from and write to files.