Fair Use Law
Without permission, generally you can only use a sample of another artist's creation if it falls under the "fair use" doctrine. The law does not provide that you may use a specified amount of material, such as a number of paragraphs of text or seconds of music, before you are in violation of copyright law, meaning the copyright holder could sue you for using even a small amount of material. Instead, courts will consider a number of factors, including the purpose of the use, the nature of the work being sampled, how much of the original was used, and the impact on the original work. Use that is noncommercial but instead for nonprofit educational purposes is more likely to be considered fair use. Courts also will consider if the copyright holder is impacted by your use of the sample, such as if the public is less likely to purchase the original album of music because they can access the music through your new composition. Even if your use of another's work falls under the definition of "fair use," you are generally only allowed to use a portion of the work as necessary, such as limiting your quotes from a book as needed for your scholarly paper.
The U.S. Copyright Office recommends that if you are at all in doubt as to whether your use of copyrighted material is fair use, you should ask permission from the copyright owner to use the material. Again, without permission, you are limited to using only the amount of material that is necessary; you cannot replicate someone else's work substantially without permission. It is not always the creator of the work who owns the copyright -- often music is owned by a publishing company, for example. In addition, if you want to use an actual recording of the song instead of re-recording your own version, you must obtain permission from the copyright holder of the song recording as well, which is often a recording studio or label.
Paying for a License
If copyright holders allow you to use their work that doesn't fall under the fair use exception, which they are not required to do, they may charge a fee for the license, which allows you to use the sample. The cost for a license is not mandated by the law and can vary significantly based on the artist and your use of the material, such as the length of the sample you want to use. You may be charged a flat fee to use the sample, or you may pay based on how many productions, such as records, you create or sell. You may seek the help of an attorney to track down the copyright holder and negotiate a license agreement.
Copyright Infringement Consequences
If you sample something without permission, it is possible that the copyright holder will bring a lawsuit against you. Courts have not provided specific rules as to when sampling is considered infringement, although samples used in parody, education or research are more likely to be considered fair use. If the copyright holder is successful in his lawsuit against you, you could be ordered to pay any damages that resulted from your unlawful use of the sample, as well as statutory damages up to $150,000, attorney's fees and court fees.