Every team is given one mid-level exception (MLE) every season. Each team is given a Million Dollar exception (sometimes referred to as the lower-level exception or LLE) as long as they didn't use the Million Dollar exception in the previous season. In other words, if a team used their Million Dollar exception in 2003-04, they will not get a Million Dollar exception in 2004-05, but would get a Million Dollar Exception in 2005-06.
However, if at any point the team drops below the cap, they lose these exceptions. They are only retained as long as the team remains above the cap. So, if a team is still under the cap when they are granted these exceptions, they immediately lose them and don't get to use them. Or, if a team drops below the cap later on in the year, they lose any unused exceptions.
The MLE is defined as the average player salary. This year it was $4.917 million. It will be about the same amount next year - perhaps even a bit lower. The MLE can be split up to sign more than one player. Contracts signed using the MLE can be up to 6 years in length.
The Million Dollar exception is set by the Collective Bargaining Agreement. This year it was $1.5 million and it will be $1.6 million next year. It can also be split up to sign more than one player. However, contracts signed using the Million Dollar Exception can only be up to 2 years in length.
If you're interested in a more explicit description of exceptions, I encourage you to read Larry Coon's FAQ on the CBA/Salary Cap,
especially question #17.