She was fired
According to her page on Memory Alphaher page on Memory Alpha, she wanted to pursue other directions in her career.
As per Memory Alpha:
McFadden left the series at the end of the first season and was replaced by Diana Muldaur as Doctor Katherine Pulaski in the second season. An official announcement states, that McFadden had left the series to pursue other career options. McFadden herself got a call from her agent who told her that the producers decided to go in another direction with the character. Like the other cast members, McFadden was surprised. ("Gates McFadden - Dr. Beverly Crusher", The Official Star Trek: The Next Generation Magazine Vol. 12, p. 43)
Interestingly enough though, that's not what Wikipedia has to say:
At the end of the first season, McFadden was fired and replaced by actress Diana Muldaur as the Enterprise's Chief Medical Officer.
This excerpt references the following section from an interview with director Rick Berman:
Gates McFadden fired at end of first season because head writer Maurice Hurley "he had a real bone to pick" with Gates and din’t like her acting, Berman brought Gates back for 3rd season after Hurley left
(Source)
As for her return:
But thanks to a letter-writing campaign, support from Patrick Stewart, and a personal invitation from Rick Berman, McFadden was brought back to the TNG cast for the third and subsequent seasons. McFadden was absent for all episodes of the second season and only appeared in stock footage in "Shades of Gray" which was used from the first season episodes "Symbiosis" and "Skin of Evil".
Apparently, there was disappointment that Hurley didn't live up to expectations:
Muldaur's character, Dr. Katherine Pulaski, didn't make it to the third season. Roddenberry described Muldaur as "a most talented actress", and said that the decision "to let her go was made solely because the hoped-for chemistry between her and the rest of the starship cast did not develop."
(Source)
And, just to clarify the in-universe reason, Crusher was offered a position as the head of Starfleet Medical according to Memory AlphaMemory Alpha.