How to write dimensions below a matrix

Use \underset, with \scriptscriptstyle in order to reduce the size.

Note that loading mathpazo does nothing unless you select suitable font themes.

\documentclass{beamer}

\usefonttheme{serif}
\usefonttheme{professionalfonts}
\usepackage{mathpazo}

\begin{document}

\begin{frame}\frametitle{Write dimensions below matrix}

\[
\begin{bmatrix}
\underset{\scriptscriptstyle n\times n}{A} &
\underset{\scriptscriptstyle n\times n}{B} \\[1.5ex]
C & D
\end{bmatrix}
\]

\end{frame}
\end{document}

Avoid awkward constructions such as \begin{center}$<formula>$\end{center}: displaymath is much better, with its shorthand \[...\].

enter image description here


with using of the package stackengine:

\documentclass{beamer}

\usepackage{amssymb}
\usepackage{mathpazo}
%\usepackage{multimedia} not relevant for your problem
%\usepackage{amsfonts}   loaded by amssymb
\usepackage{amsmath}
%\setcounter{MaxMatrixCols}{10}
\usepackage{stackengine}



\begin{document}

\begin{frame}
\frametitle{Write dimensions below matrix}
\[\stackMath
\begin{bmatrix}
\stackunder{A}{_{n\times n}}  & \stackunder{B}{_{n\times n}} \\[2ex]
         C              &          D
\end{bmatrix}%
\]
\end{frame}
\end{document}

enter image description here

or see, if writing matrix symbol in \mathbf{...} better emphasize matrices:

\begin{frame}
\frametitle{Write dimensions below matrix}
\[\stackMath
\begin{bmatrix}
\stackunder{\mathbf{A}}{_{n\times n}}  & \stackunder{\mathbf{B}}{_{n\times n}} \\[2ex]
         C              &          D
\end{bmatrix}%
\]
\end{frame}

which gives

enter image description here