Keyword density is a measure of how dense (how richly distributed) keywords or keyterms (search terms) are, within an article or other span of content.
It’s a rather dated (often abused, and easily detected) indicator of relevancy for search engines.
In terms of scope, keyword density can be measured within a page, or a section of a page, or a group of pages, or a site as a whole. However it is usually measured on a per article basis (or per the main content section of a single page).
Beware of Keyword Stuffing
Having too many keywords stuffed into a paragraph or other section of content, can reduce the natural readability of the text, making for a poor user experience – this is an old-fashioned, controversial SEO technique known as ‘keyword stuffing’ which is easily detected and readily penalised by search engines these days.
Measuring Keyword Density
Some SEO copywriting professionals will measure keyword density as a percentage of how many times a particular keyword is mentioned on a page against how many words in total are on that page (or in an article, etc).
The value of this measurement is often over-emphasised considering Google’s ability to spot synonyms these days, but it’s also often under-emphasised considering the second biggest mistake in SEO (after not having a crawlable website) is not mentioning the main keywords on a page!
It is the consensus among contemporary SEO experts that mentioning all important keywords at least once per relevant landing page is a good idea (dense enough for good targeting, without being spammy) so long as those keywords fit comfortably within the natural flow of text for great readability and general user experience.
Similarly, the overall quantity of text should only be extended to accommodate keyword stuffing as far as the page layout design can accommodate that quantity of text, else a poor user experience can occur which will increase bounce rates and damage rankings thus be counter productive.