\documentclass{book}
\usepackage{amsthm}
\usepackage{xparse}

\usepackage{xepersian}

\newcommand\thmcite{}

\newtheoremstyle{mystyle}% name
  {\topsep}%Space above
  {\topsep}%Space below
  {\itshape}%Body font
  {0pt}%Indent amount
  {\bfseries}% Theorem head font
  {\hspace{2mm}}%Punctuation after theorem head
  {0pt}%Space after theorem head 2
  {\thmname{#1}~\thmnumber{#2}\hspace{-1mm}\thmnote{~(#3)}\thmcite}%Theorem head spec (can be left empty, meaning ‘normal’)

\theoremstyle{mystyle}
\newtheorem{theo}{قضیه}[section]

\DeclareDocumentEnvironment{theorem}{O{}o}
  {\IfNoValueTF{#2}{}{\renewcommand\thmcite{~(#2)}}\begin{theo}[#1]}
  {\end{theo}}

\begin{document}
\chapter{نام}
\section{نام}

\begin{theorem}[نام قضه]%[\cite{1}]
متن
\end{theorem}

\begin{theorem}[نام قضه]
متن 
\end{theorem}

\begin{theorem}[نام قضه][\cite{1}]
متن 
\end{theorem}

\begin{theorem}
متن 
\end{theorem}

\begin{thebibliography}{9}
\bibitem{1} 
مرجع شما
\end{thebibliography}

\end{document}