On Amazon:
It’s rather easy to set up pre-order on Amazon. You can do a long pre-order (like a couple months) or a short one, though the shortest amount of time you can possibly have your book available for pre-order is three days before release. Be careful, though, You need to upload a final draft of your book 10 days in advance or you will be banned from pre-order for a year. Now, this doesn’t need to be THE final file, you can still go in and change it until you are locked out of the book information approx. 72h before release. (Which is why 3 days is the shortest time-span for pre-orders.) But it is important that you upload a file and tick the ‘this ist the final draft’ box 10 days before the release date. (If you’re creating your book, let’s say 4 days before release, just tick this from the get-go)

Now, *should* you do a pre-order?
To discuss this, it’s important to understand how pre-orders influence sales rank. You want a good sales rank around release to give your book maximum visibility. To get that, you need a good number of sales counted *on the day of release*, or shortly before, or shortly after. Pre-order sales are counted *on the day they’re made*. So if your release date is March 12, but twenty people pre-ordered your book March 1, those twenty sales aren’t going to help you any around release. This is how having a long pre-order time can actually hurt you because it can prevent your book from getting a high enough release day sales spike to catapult you up the rankings.
Pre-orders *are* good to get the sales link early, to ensure that the book is actually available on your planned release day (in case of promotion etc) and they can sometimes be beneficial in the case of book series, where you can put a pre-order link to book 2 in the back of book 1 (though how beneficial this actually is is still debated often.)
Another upside of pre-orders is that you can potentially double the time your book spends on the “Hot and New” list at Amazon to get more visibilty(30 days during pre-order AND 30 days after release versus  the regular 30 days after release.) But to achieve this your book has to do very well on pre-order, so approach with caution.
Currently, it seems best to go with a short pre-order of no more than 3 days to a week to get some of the benefits without the negative impacts of drawing a pre-order out too long.