Find the relations among the angles of the triangle $ABC$ whose altitude $AH$ and median $AM$ satisfy $\angle BAH =\angle CAM$.
1. Let $\triangle ABC$ be a triangle with $AH$ as the altitude from $A$ to $BC$ and $AM$ as the median from $A$ to $BC$. Given that $\angle BAH = \angle CAM$.

2. Since $AH$ is the altitude, $H$ is the foot of the perpendicular from $A$ to $BC$. Therefore, $\angle BAH$ is a right angle, i.e., $\angle BAH = 90^\circ$.

3. Since $AM$ is the median, $M$ is the midpoint of $BC$. Therefore, $AM$ divides $BC$ into two equal segments, $BM = MC$.

4. Given that $\angle BAH = \angle CAM$, we need to explore the conditions under which this equality holds.

5. Consider the circumcenter $O$ of $\triangle ABC$. The circumcenter $O$ lies on the perpendicular bisector of $BC$ and is equidistant from $B$ and $C$.

6. Since $O$ must lie on $AM$ (the median) and also on the perpendicular bisector of $BC$, $O$ coincides with $M$ if and only if $\angle A = 90^\circ$. This is because the perpendicular bisector of $BC$ will pass through $A$ only if $\angle A$ is a right angle.

7. Alternatively, if $AM$ and the perpendicular bisector of $BC$ are the same line, then $AB = AC$. This is because the median $AM$ will be the angle bisector of $\angle BAC$ only if $AB = AC$.

8. Therefore, the given condition $\angle BAH = \angle CAM$ implies either $\angle A = 90^\circ$ or $AB = AC$.

Conclusion:
\[
\boxed{\angle A = 90^\circ \text{ or } AB = AC}
\]