When growing up, I remember being frequently told the proverbial stories about Einstein as a child, how he did poorly in school and even failed in mathematics. While Einstein was not necessarily the best student in class, he never did particularly poorly in school, aside from a handful of instances where he ran afoul of teachers that he didn't get along with. And he certainly never failed mathematics.
The relationship between Einstein and mathematics has always been a tenuous one. He considered becoming a mathematician, but chose physics because he felt it could lead to more significant truths about reality.*
Einstein frequently lamented his own problems in mathematics throughout his career, as he went on to revolutionize the field of physics. He frequently enlisted the aid of other mathematicians, including his first wife, to check his work for errors, and they were frequently found which has led some to believe that he was a bad mathematician and probably helped to give rise to the rumour.
Still, the fact is that Einstein had a very firm grasp on sophisticated mathematical concepts, even if he did occasionally need to enlist aid in formalizing his theoretical descriptions. He always understood the mathematics that he was working with once he was able to get help in hammering out the specific details.
*This was a notion that Einstein would revise years later, as he befriended logician Kurt Godel at the Institute for Advanced Study in Princeton, New Jersey. Godel, ironically, had once considered becoming a physicist, but had chosen mathematics because he felt that it was more "perfect" and, therefore, could be used to more accurately describe the nature of truths about reality.