If you're using one of the standard document classes (article, book or report), the macro \@ptsize contains 1 if you're using 11pt:
\documentclass[12pt]{article}
\makeatletter
\AtBeginDocument{%
\newcommand{\@ptsizetest}{1}% Equivalent to 11pt for a document class option.
\ifx\@ptsizetest\@ptsize\relax\else
\@latex@error
{You need to use 11pt font size}% Error message
{Add this as a document class option [11pt]}% Help text
\fi%
}
\makeatother
\begin{document}
Test document
\end{document}
This creates the error
LaTeX Error: You need to use 11pt font size.
If you're using other packages that define the font size, some more work is required.