Use a variant of the \tmark command defined in my answer to Moving an object to the right margin
\documentclass{article}
\usepackage{amsthm}
\makeatletter
\renewcommand\@endtheorem{\vvv@endmarker\endtrivlist\@endpefalse}
\newcommand\vvv@endmarker{%
{\unskip\nobreak\hfil\penalty50
\hskip2em\vadjust{}\nobreak\hfil\openbox
\parfillskip=0pt \finalhyphendemerits=0 \par
\penalty 10000 \parskip=0pt\noindent}\ignorespaces}
\makeatother
\newtheorem{thm}{Theorem}
\begin{document}
\begin{thm}
Zigzagging is dangerous.
\end{thm}
\begin{thm}
Zigzagging is very dangerous.
Zigzagging is very very dangerous.
\end{thm}
I want to show that the \verb|\hfill| approach can fail.
\makeatletter
\def\vvv@endmarker{\hfill\openbox}
\makeatother
\begin{thm}
Zigzagging is dangerous.
\end{thm}
\begin{thm}
Zigzagging is very dangerous.
Zigzagging is very very dangerous.
\end{thm}
\end{document}
I added an example showing that the simple \hfill approach can fail.

A method that allows for itemized lists or displayed equations at the end, with correct marking using \qedhere is
\documentclass{article}
\usepackage{amsthm}
\newcommand{\newmarkedtheorem}[1]{%
\newenvironment{#1}
{\pushQED{\qed}\csname inner@#1\endcsname}
{\popQED\csname endinner@#1\endcsname}%
\newtheorem{inner@#1}%
}
\newmarkedtheorem{thm}{Theorem}[section]
\begin{document}
\section{Test}
\begin{thm}
Zigzagging is dangerous.
\end{thm}
\begin{thm}
Zigzagging is very dangerous.
Zigzagging is very very dangerous.
\end{thm}
\begin{thm} These activities are dangerous.
\begin{itemize}
\item Zigzagging
\item Jaywalking\qedhere
\end{itemize}
\end{thm}
\end{document}
The command \newmarkedtheorem has the same syntax as \newtheorem.

amsthm? Or you want to modify any environments such asquoteorcenter? – Symbol 1 Sep 19 '14 at 06:53ntheorempackage has atheoremsymbol{your_preferred_symbol}command, after which all declared theorems use the symbol, until another symbol is declared. Thus you can have each theorem-like environment have an end-of-theorem symbol (and even have its own). – Bernard Sep 19 '14 at 09:46