Both! Humans are complicated, sexuality is complicated. For some people they know they're absolutely gay or straight from a young age, for some it changes as they get older. I didn't know I was bi until the end of highschool, because the idea of liking the same gender seemed so weird because society SAID it was weird so i ASSUMED i only liked the opposite gender. In more conservative cultures it might take even longer to realise.