I think the best treatment of basic facts about capacity from the perspective of Sobolev spaces is in Chapter 4 of
L. C. Evans, R. F. Gariepy,L. C. Evans, R. F. Gariepy, Measure theory and fine properties of functions. Revised edition. Textbooks in Mathematics. CRC Press, Boca Raton, FL, 2015. (MathSciNet review).
The book of Maz'ya (see Changyu Guo's answer) is very comprehensive, but difficult to read and I would not recommend it as an introduction. The book by Heinonen is about analysis on metric spaces so this is a different story and the book by Heinonen, Kilpelainen and Martio deals with a quite advanced nonlinear potential theory. This being said, if you want to learn basic results about capacity theory read Evans and Gariepy!