If you plan to use this only for first level lists and don't plan to use the enumitem package for personalizing the environment, using a \label in the last item is sufficient.
However a general solution that allows for rearrangement of items without bothering with the position of \label, is compatible also with enumitem and also works for nested list can be the following:
\documentclass[a4paper]{article}
\makeatletter
\newenvironment{enumeratecount}[1]
{\def\thisenumeratecountlabel{#1}\enumerate}
{\edef\@currentlabel{\number\value{\@enumctr}}%
\label{\thisenumeratecountlabel}\endenumerate}
\makeatother
\begin{document}
The following list contains~\ref{firstlist} items, while
the nested list contains~\ref{innerlist}.
\begin{enumeratecount}{firstlist}
\item item A
\item item B
\begin{enumeratecount}{innerlist}
\item sub A
\item sub B
\end{enumeratecount}
\item item C
\end{enumeratecount}
The previous list contains \ref{firstlist} items, while the
inner list contains~\ref{innerlist}.
\end{document}
You just use \begin{enumeratecount}{<label>} for stating the label to be used (before or after the environment) for getting the number of items.
If you use enumitem you can even say
\begin{enumeratecount}{<label>}[<enumitem settings>]
so, for instance,
\begin{enumeratecount}{mylist}[label=\Alph*]
would work correctly (which wouldn't with the "simple method" outlined above and in Ulrike's answer).
The solution uses a couple of facts: a \label command refers to the current value of \@currentlabel, so before doing \endenumerate we define \@currentlabel to be the complete expansion of \value{\@enumctr}. The macro \@enumctr expands to enumi, enumii, enumiii or enumiv depending on the nesting level of the current enumerate environment; thus we're guaranteed to get the right number at all levels. Then we say \label{\thisenumeratecountlabel} that will set the label name to the original argument to enumeratecount. Locality of environments does the rest.
An extension
Suppose we want to say "the following list contains 1 item" or "the following list contains 3 items", adding the "s" conditionally.
This can be done with the help of the refcount package.
\usepackage{refcount}
\newcommand{\addphrase}[3]{% #1 = label, #2 = text if number >1, #3 = text if number =1
\ifnum\getrefnumber{#1}>1
#2%
\else
#3%
\fi}
So the text above can be generated by
the following list contains \ref{firstlist}~\addphrase{firstlist}{items}{item}
itemize. – egreg Feb 07 '13 at 11:42\getrefnumber{firstlist}in place of your\NumberOfItems(requires the packagerefcount;firstlistis just the label assigned to the environment withenumeratecount) as I showed in my previous answer. – egreg Feb 08 '13 at 11:27