A mechanical license grants an artist permission to reproduce and distribute a song someone else wrote (ie. the lyrics, underlying melody and character of the song). For example, purchasing a mechanical license will legally cover an artist to record and distribute a cover of another artist's song, but cannot be used in the case of sampling, editing or changing the original work.
Mechanical Licenses can be purchased from the owner or rights holder (i.e. music publisher or the original songwriter/s) of the song you wish to cover, or from an agency that represents a larger group of publishers. In the U.S. you can purchase a mechanical license from The Harry Fox Agency, Loudr or Easy Song Licensing.