Do you need to know what you're writing before you start? Or can you wait till it's time to send it out? And do you want to write to a strict genre anyway or are you more of a mould-breaker?
From the point of view of a publishing house and a bookseller, the clearer you can be about your genre, the better.
Let's start with the basics - are you writing fiction or non-fiction? This is not as stupid a question as you might think. I have read a number of submission letters that start with 'My novel is all TRUE', or 'I'm writing about an important issue but I've turned it into fiction'. Try and draw a line, and decide which side of it you're writing.
Then - adult or children? Very very few books are genuinely cross-over titles. I know Philip Pullman and JK Rowling managed it - but what they actually did was to write children's books that appealed to adults, rather than attempt a hybrid.
If you're writing for children, what age are you aiming it at? The most common mistake I see when reviewing submissions is that the author has aimed a book at 'children from 3 to 13'. Very few - if any- books will appeal across that wide an age bracket. Have a look at your local bookshop and how they divide up books for children, and use that as your blueprint for where your book would sit.
All that seems strikingly easy compared to catergorising adult fiction. Is your novel chick-lit (or has that had its day - see this Guardian article), crime, romance, historical, literary, mass-market - or something else? And how can you tell?
By the time you're seriously writing a book, you should know what sort of book you're writing. Think of it less as pigeon-holing, and more as defining the sort of reader you're looking for.
Remember, you don't have to restrict yourself to one area of writing. Jo Nesbo, dark Norwegian crime writer, also writes humorous children's books. Louisa May Alcott wrote inspiring children's fiction, and shocking 'sensation' novels. Iain Banks writes literary fiction, while his alter-ego Iain M.Banks writes science fiction. Just make sure each piece of writing contains its own coherent identity.
What genre are you writing currently? And how easy is it for you to define your genre? An inspiring blogger is writing 12 books in 12 different genres over a year - see Ali George's website. Why not try a different genre, just as an exercise?