We are given two nonzero vectors \( \overrightarrow{a} \) and \( \overrightarrow{b} \), and the condition:
\[
|\overrightarrow{a} \times \overrightarrow{b}| = |\overrightarrow{a} \cdot \overrightarrow{b}|.
\]
The magnitude of the cross product of two vectors is given by:
\[
|\overrightarrow{a} \times \overrightarrow{b}| = |\overrightarrow{a}| |\overrightarrow{b}| \sin \theta,
\]
where \( \theta \) is the angle between the vectors \( \overrightarrow{a} \) and \( \overrightarrow{b} \).
The magnitude of the dot product of two vectors is given by:
\[
|\overrightarrow{a} \cdot \overrightarrow{b}| = |\overrightarrow{a}| |\overrightarrow{b}| \cos \theta.
\]
Since the magnitudes of the vectors \( \overrightarrow{a} \) and \( \overrightarrow{b} \) are nonzero, we can divide both sides of the equation by \( |\overrightarrow{a}| |\overrightarrow{b}| \), giving:
\[
\sin \theta = \cos \theta.
\]
This equation holds when:
\[
\theta = \frac{\pi}{4}.
\]
Thus, the angle between \( \overrightarrow{a} \) and \( \overrightarrow{b} \) is \( \frac{\pi}{4} \), and the correct answer is option (B).