Approaches where a temporary macro \temp is defined by \StrGobbleRight only work out as long as the string in question does not contain hashes (#).
You can have the toplevel-expansion of \temp as an argument of another macro which does the actual work:
\documentclass{article}
\usepackage{xstring}
\newcommand{\test}[1]{%
\begingroup
\StrGobbleRight{#1}{1}[\temp]%
\expandafter\endgroup\expandafter\innertest\expandafter{\temp}%
}%
\newcommand\innertest[1]{%
\expandafter\newcommand\csname#1\endcsname{Name: #1}%
}%
\begin{document}
\test{aaax}
\test{bbbx}
\texttt{\string\aaa:\meaning\aaa}
\texttt{\string\bbb:\meaning\bbb}
\end{document}

If ε-TeX-extensions are allowed you can use \protected@edef and wrap everything but \temp into \unexpanded—actually in this example \unexpanded is not needed as the characters Name: are not expandable, but there might be something like \newtheorem instead:
\documentclass{article}
\usepackage{xstring}
\makeatletter
\newcommand{\test}[1]{%
\StrGobbleRight{#1}{1}[\temp]%
\expandafter@ifdefinable\csname\temp\endcsname{%
\expandafter\protected@edef\csname\temp\endcsname{\unexpanded{Name: }\temp}%
}%
}%
\makeatother
\begin{document}
\test{aaax}
\test{bbbx}
\texttt{\string\aaa:\meaning\aaa}
\texttt{\string\bbb:\meaning\bbb}
\end{document}

If you like it complicated you can apply \expandafter before \Exchangeing tokens.
You can use \romannumeral for keeping expansion going until a non-positive number is found.
(\romannumeral silently discards non-positive numbers without delivering any token in return.)
With the example below \Stopromannumeral denotes the number 0 in a way where you don't have unwanted removal of a trailing space token and where no explicit character-token 0 is involved which could probably be affected/changed by \uppercase/\lowercase.
The \expandafter-chain launched during the expansion of \csname launches \romannumeral-expansion.
\romannumeral in turn triggers expanding the two \expandafter behind the \romannumeral-token which in turn yields toplevel-expansion of \temp.
Then \romannumeral triggers \Exchange.
After that \Stopromannumeral, i.e., a TeX-⟨number⟩-quantity of value "0", is found which ends \romannumeral with \romannumeral discarding the tokens forming that ⟨number⟩-quantity without delivering tokens in return.
\documentclass{article}
\usepackage{xstring}
\makeatletter
\newcommand\Exchange[2]{#2#1}%
@ifdefinable\Stopromannumeral{\chardef\Stopromannumeral=`^^00}%
\makeatother
\newcommand{\test}[1]{%
\StrGobbleRight{#1}{1}[\temp]%
\expandafter\newcommand
\csname\temp\expandafter\endcsname
\expandafter{%
\romannumeral
\expandafter\Exchange\expandafter{\temp}{\Stopromannumeral Name: }%
}%
}%
\begin{document}
\test{aaax}
\test{bbbx}
\texttt{\string\aaa:\meaning\aaa}
\texttt{\string\bbb:\meaning\bbb}
\end{document}

\newtheorem, why not simply doing\newcommand{\test}[1]{\newtheorem{#1}{Name: #1}}? – egreg Mar 07 '21 at 10:12*at last and remove the*if it does. The resulted string is\temp, and is used in many places. It is a little bit hard for me do make a real MWE. – Jinwen Mar 07 '21 at 10:16\CreateTheorem. Previously I'm asking things related to it, but was hard to read and to answer. – Jinwen Mar 07 '21 at 11:39