Does Apple allow buying a new phone through its website the day it's released? I am new to Apple and I am not sure how it does things with new phones, but I wanted to know if and when the next iPhone is released will it be made available on its website the day it's released?

I tried finding some info regarding this online but it's hard to get good information of when they updated their website and if it was made available on the same day.

If it is, I don't quite understand why people would line up and wait hours to get it or am I missing something?
The only thing you're missing is the need to be part of the party.
People like queuing up to be first.

If you pre-order it online* you can answer the door in your pyjamas &amp; get your phone the same day, without the queue. I've known them arrive at 8am on release day.  

*Note: If you wait too long to pre-order, you won't get it on the first day, but some time later, depending on how popular the release is.

Announcements are usually made in the first week or so of September, with the release being about a week later. The online stores will go live for pre-orders at about the time the announcement/conference ends. They will be closed for the day up to that point.
No date has yet been set for even the announcement, so at present everything is still speculation.