Magnetic skyrmions are topologically stable nanoscale particle-like objects that were discovered in 2009. Since that time, intense research interest has led to the identification of numerous compounds that support skyrmions over a range of conditions spanning cryogenic to room temperatures. Skyrmions can be set into motion under various types of driving, and the combination of their size, stability, and dynamics makes them ideal candidates for numerous applications. Skyrmions represent a new class of system in which the energy scales of the skyrmion-skyrmion interactions, sample disorder, temperature, and drive can compete. A growing body of work indicates that the static and dynamic states of skyrmions can be influenced strongly by pinning or disorder in the sample; thus, an understanding of such effects is essential for the eventual use of skyrmions in applications. In this article we review the current state of knowledge regarding individual skyrmions and skyrmion assemblies interacting with quenched disorder or pinning. We outline the microscopic mechanisms for skyrmion pinning, including the repulsive and attractive interactions that can arise from impurities, grain boundaries, or nanostructures. This is followed by descriptions of depinning phenomena, sliding states over disorder, the effect of pinning on the skyrmion Hall angle, the competition between thermal and pinning effects, the control of skyrmion motion using ordered potential landscapes such as one- or two-dimensional periodic asymmetric substrates, the creation of skyrmion diodes, and skyrmion ratchet effects. We highlight the distinctions arising from internal modes and the strong gyroscopic or Magnus forces that cause the dynamical states of skyrmions to differ from those of other systems with pinning. We also discuss future directions and open questions related to the pinning and dynamics in skyrmion systems.