Step 1: Torque on a magnetic dipole $\vec{m}$ in a magnetic field $\vec{B}$ is
\[
\tau = mB\sin\theta
\]
where $\theta$ is the angle between $\vec{m}$ and $\vec{B}$.
Step 2: Torque is maximum when
\[
\sin\theta = 1 \Rightarrow \theta = 90^\circ
\]
Step 3: Potential energy of a magnetic dipole in a magnetic field is
\[
U = -mB\cos\theta
\]
Step 4: At $\theta = 90^\circ$,
\[
\cos 90^\circ = 0 \Rightarrow U = 0
\]
Step 5: Hence, when the torque is maximum, the potential energy is zero.