Pixel density in 2D sensors (*), like any other density, is the number of pixels per unit area. A sensor size is given (usually in mm or inch) and thus its area. A given sensor is divided to separate light sensitive locations, which are the sensor elements, or photosites/sensels. In the most common arrangement, these sensels are square in shape and form a linear, uniform grid (**).
The pixel density is the ratio of the total number of pixels to the area of the sensor. It is equal to the number of sensels in a unit area of the sensor.
The higher this ratio, the smaller the individual photosites. The smaller they are, the noisier the individual pixel gets. OTOH, higher densities, meaning higher resolution sensors, increase the resolving power of the electro-optical system up to a point of a diminishing return.
For example, the Canon EOS 7D has an APS-C size sensor with ~18 Megapixels (effective). its density is then 18e6 / (22.3 x 14.9) = ~54Kpix/mm^2. The EOS 5D Mk2 has a 35mm sensor with 21 MP. Its density is 21e6 / (36 x 24) = ~24Kpix/mm^2. Thus, the 5D2 sensels are about twice as big as the 7D's sensels and hence are more immune to noise.
Further discussion on the effect of density on quality can be found here.
(*) linear sensors, like in line scanners, can have sensels arranged in a single line and thus the density is the number of pixels per unit length.
(**) Other sensels arrangements exist, notably Fugi's SuperCCD sensors where the sensels are not placed in a regular matrix, but as a diagonal stack. Nevertheless, the arithmetic for pixel density still applies here.