Project format and files
IntelliJ IDEA stores the configuration data for projects and their components in plain text XML files making it easy to manage and share project configuration data with others.
When the directory-based format is used, there is a .idea directory in the project directory.
The .idea directory contains a set of configuration files (.xml). Each file contains only a portion of configuration data pertaining to a certain functional area which is reflected in the name of a file, for example, compiler.xml, encodings.xml, modules.xml.
Almost all of the files contain information core to the project itself, such as names and locations of its component modules, compiler settings, etc. Thus, these files may (and should) be kept under version control.
The exception is the file workspace.xml. It stores your personal settings such as placement and positions of your windows, your VCS and History settings, and other data pertaining to the development environment. So it's unlikely that you'd want to share this file with your colleagues.
If the file-based format is used, there are two configuration files in the project directory. One of the files has the .ipr extension and stores the core project information. The other file has the .iws extension and stores your personal workspace settings.
The .iws file shouldn't be placed under version control while the .ipr file should.
The file-based format can be converted into the directory-based, see Converting Projects Into Directory-Based Format.