How to use \footnotesize with longtable command?

This should work:

Text before the long table

{\footnotesize
\begin{longtable}{lll}
<data>
\end{longtable}}

Text after the long table

This will also work:

Text before longtable

\begin{footnotesize}
\begin{longtable}{llll}

Table data...

\end{longtable}
\end{footnotesize}

Text after longtable

I would suggest to create an environment for the table. In this environment one can configure all aspects of the table. If there is an complex table it is easier to keep track of the configuration and you can reuse it for more than one table. This definition is placed in the preamble of the document to keep splitting content from formating stuff. Furthermore this is significant when you input the data automatically via a (Lua or Perl) script, because you don't have to write the formating stuff again and again. You just put the data into the created environment.

\documentclass{book}
\usepackage{longtable}

\newenvironment{myTable}%
{%
    \footnotesize
    \setlength\tabcolsep{1.4ex}
    % other formating stuff
    \begin{longtable}{ccc}
    Column 1 &Column 2 &Column 3\\
    \hline
}%
{%
    \end{longtable}
}%


\begin{document}
Text

\begin{myTable}
    A&B&B\\
    D&E&F
\end{myTable}

Text
\end{document}