How could I get that equation?

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
Z = \begin{cases}
1 & \text{if the outcome is a success} \\
0 & \text{if the outcome is a failure}
\end{cases}
\end{equation}
\begin{equation}
Z = \begin{cases*}
1 & if the outcome is a success \\
0 & if the outcome is a failure
\end{cases*}
\end{equation}
\end{document}

While cases is suppled by amsmath (which is loaded by mathtools) cases* is provided by the latter. In this the second column is in text mode, hence no need of using text macro. mathtools provides some other cases like environments too. Here is a screen shot from the manual (section 3.4.3, page 18):
