Story should determine itself, not how many books you want in your series. My series will actually have four books, because that is how many are needed to serve the story. Not the other way around.
Each book should be able to stand on it's own. I've read a number of very frustrating "trilogies" that were, in fact, only one story broken up into three parts, beginning, middle, and end. In other words, there was no conclusion at the end of the first book, or the second. Too bad for you if you didn't want to read all of them, or if you had to wait years between the release of each volume. While there is an overarching plot that is threaded through all four of my manuscripts, I have worked very hard to have distinct plots for each, and I hope readers will find them satisfying in themselves.
If you are writing a book, don't feel pressured to come up with a certain number of books. Sometimes the story is best told in one. Other times many more are needed. Do what works best for you and the story you are telling.