Forces between two or more molecules or atoms, either attractive or repulsive, are called intermolecular forces. Intermolecular forces are experienced by molecules when they are within physical proximity of one another. These forces are very important for properly modeling molecular systems, as to accurately predict the microscopic behavior of molecules in any system, and therefore, are necessary for accurately predicting the physical properties of gases (and liquids) across wide variations in physical conditions.
Arising from the study of physical chemistry, one of the most prominent intermolecular forces throughout physics, are van der Waals forces. Van der Waals forces play a key role in determining nearly all physical properties of fluids such as viscosity, flow rate, and gas dynamics (see physical characteristics section). The van der Waals interactions between gas molecules, is the reason why modeling a "real gas" is more mathematically difficult than an "ideal gas".  Ignoring these proximity-dependent forces allows a real gas to be treated like an ideal gas, which greatly simplifies calculation.
The intermolecular attractions and repulsions between two gas molecules are dependent on the amount of distance between them. The combined attractions and repulsions are well-modelled by the Lennard-Jones potential, which is one of the most extensively studied of all interatomic potentials describing the potential energy of molecular systems.  The Lennard-Jones potential between molecules can be broken down into two separate components: a long-distance attraction due to the London dispersion force, and a short-range repulsion due to electron-electron exchange interaction (which is related to the Pauli exclusion principle).  
When two molecules are relatively distant (meaning they have a high potential energy), they experience a weak attracting force, causing them to move toward each other, lowering their potential energy. However, if the molecules are too far away, then they would not experience attractive force of any significance. Additionally, if the molecules get too close then they will collide, and experience a very high repulsive force (modelled by Hard spheres) which is a much stronger force than the attractions, so that any attraction due to proximity is disregarded. 
As two molecules approach each other, from a distance that is neither too-far, nor too-close, their attraction increases as the magnitude of their potential energy increases (becoming more negative), and lowers their total internal energy. The attraction causing the molecules to get closer, can only happen if the molecules remain in proximity for the duration of time it takes to physically move closer. Therefore, the attractive forces are strongest when the molecules move at low speeds. This means that the attraction between molecules is significant when gas temperatures is low. However, if you were to isothermally compress this cold gas into a small volume, forcing the molecules into close proximity, and raising the pressure, the repulsions will begin to dominate over the attractions, as the rate at which collisions are happening will increase significantly. Therefore, at low temperatures, and low pressures, attraction is the dominant intermolecular interaction. 
If two molecules are moving at high speeds, in arbitrary directions, along non-intersecting paths, then they will not spend enough time in proximity to be affected by the attractive London-dispersion force. If the two molecules collide, they are moving too fast and their kinetic energy will be much greater than any attractive potential energy, so they will only experience repulsion upon colliding. Thus, attractions between molecules can be neglected at high temperatures due to high speeds. At high temperatures, and high pressures, repulsion is the dominant intermolecular interaction.
Accounting for the above stated effects which cause these attractions and repulsions, real gases, delineate from the ideal gas model by the following generalization:
* At low temperatures, and low pressures, the volume occupied by a real gas, is less than the volume predicted by the ideal gas law.
* At high temperatures, and high pressures, the volume occupied by a real gas, is greater than the volume predicted by the ideal gas law.