As previously answered on another Stack Exchange site; some things were certainly pre-planned (h/t yannis in the comments). According to an archived version of Potter FAQ on Rowling's website:
'The Half-Blood Prince' might be described as a strand of the overall
plot. That strand could be used in a whole variety of ways and back in
1997 I considered weaving it into the story of 'Chamber'. It really
didn't fit there, though; it was not part of the story of the basilisk
and Riddle's diary, and before long I accepted that it would be better
to do it justice in book six. I clung to the title for a while, even
though all trace of the 'Prince' storyline had disappeared, because I
liked it so much (yes, I really like this title!). I re-christened
book two 'Chamber of Secrets' when I started the second draft.
So the ideas and title of the sixth book were there, but were moved to a later point in the story.
Rowling has also claimed that the ending of the story was written before she had found a publisher:
"I think they thought it was very arrogant of me to write the end of
my seven books series when I didn't have a publisher and no-one had
heard of me."
- "Rowling to kill two in final book," BBC News 27 June 2006
There were also many plot points that were preplanned (h/t Gallifreyan in the comments). For example, she knew in 1999 that Harry's inheritance of his mother's eyes would be important in later books. Harry's catching the snitch by mouth was a deliberate setup for a later book. See this answer for more examples.