It's a very case-by-case basis thing. When I used to write short stories, they were 50/50 on whether I planned the ending from the start or made it up when I got there.
For the series I'm currently writing, the ending for the first book was probably the very second thing I planned, and the...