You can vertically center the big expression, so the \rbrace can cover it exactly:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\left.\kern-\nulldelimiterspace
\begin{array}{@{}c@{}}
a=p^{p^{\scriptstyle p^{\cdot^{\cdot^{\cdot^{\scriptstyle p}}}}}}
\end{array}
\right\rbrace
\text{\scriptsize $n$-many $p$'s}
\end{equation*}
\end{document}

A more powerful version:
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{xcoffins}
\NewCoffin{\repexpbasecoffin}
\NewCoffin{\repexptextcoffin}
\ExplSyntaxOn
\NewDocumentCommand{\repexp}{mom}
{
\wong_repexp:nnn { #1 } { #2 } { #3 }
}
\cs_new_protected:Nn \wong_repexp:nnn
{
\tl_set:Nf \l__wong_repexp_exp_tl { \tl_tail:n { #1 } }
\tl_if_novalue:nTF { #2 }
{
\tl_clear:N \l__wong_repexp_sub_tl
}
{
\tl_set:Nn \l__wong_repexp_sub_tl { #2 }
}
\tl_set:Nx \l__wong_repexp_base_tl
{
$
\tl_head:n { #1 }
\tl_map_function:NN \l__wong_repexp_exp_tl \__wong_repexp_exp:n
\prg_replicate:nn { \tl_count:N \l__wong_repexp_exp_tl } { \c_group_end_token }
\tl_if_empty:NF \l__wong_repexp_sub_tl
{
\tl_map_function:NN \l__wong_repexp_sub_tl \__wong_repexp_sub:n
\prg_replicate:nn { \tl_count:N \l__wong_repexp_exp_tl } { \c_group_end_token }
}
$
}
\SetHorizontalCoffin{\repexpbasecoffin}{\tl_use:N \l__wong_repexp_base_tl}
\SetHorizontalCoffin{\repexptextcoffin}
{
$
\left.\kern-\nulldelimiterspace
\vphantom{\begin{tabular}{c}\tl_use:N \l__wong_repexp_base_tl\end{tabular}}
\right\rbrace
\text{\scriptsize #3}
$
}
\JoinCoffins\repexpbasecoffin[r,vc]\repexptextcoffin[l,vc]
\TypesetCoffin\repexpbasecoffin
}
\cs_new:Nn \__wong_repexp_exp:n
{
\c_math_superscript_token \c_group_begin_token \scriptstyle
\str_if_eq:nnTF { . } { #1 } { \cdot } { \exp_not:n { #1 } }
}
\cs_new:Nn \__wong_repexp_sub:n
{
\c_math_subscript_token \c_group_begin_token \scriptstyle
\str_if_eq:nnTF { . } { #1 } { \cdot } { \exp_not:n { #1 } }
}
\ExplSyntaxOff
\begin{document}
\begin{gather}
\repexp{ppp...p}{$n$ many $p$'s}
\\
a=\repexp{ppp...p}{$n$ many $p$'s}
\\
\mathfrak{q}=\repexp{{\aleph_0}{\aleph_0}{\aleph_0}...{\aleph_0}}{$q$}
\\
\repexp{abcd...x}[bcd...x]{$n$ up, $m$ down}
\end{gather}
\end{document}
As you see, the big exponential can be used on its own. The syntax is also simplified: simple letters can be inserted directly, complex symbols should be braced; a period stands for \cdot.
The optional argument is for subscripts, see the final example.

;-)– egreg Oct 15 '18 at 13:18