The standard LaTeX document classes define a small set of “page styles” which specify head- and footlines for your document (though they can be used for other purposes, too). The standard set is very limited, but LaTeX is capable of much more. The internal LaTeX coding needed to change page styles is not particularly challenging, but there’s no need — there are packages that provide useful abstractions that match the way we typically think about these things.
fancyhdr package provides
simple mechanisms for defining pretty much every head- or footline
variation you could want; the directory also contains some
documentation and one or two smaller packages.
also deals with the tedious behaviour of the standard styles with
initial pages, by enabling you to define
different page styles for initial and for body pages.