Im 2nd year at St Andrews, and depending how actively involved you are with the universtiy itself, I'd reccomend buying a gown as soon as possible. Bear in mind you cant hire undergraduate gowns, only graduation gowns.
On the first few days of Freshers week it is possible to buy a gown in the Student's Union, but the good ones get snatched up very quickly and unless youre five foot, there wont be much available.
You can buy them new of course, but (like lots of things in that town) the price will be sky high.
I would advise you to ask around and speak to some 4th years who may be willing to sell theirs down onto you, or put a 'wanted' message up in your hall when you arrive.
You'd be extremely lucky to find one on ebay but I suppose its always worth a look.
Good luck, Im sure you'll have a fantastic time up at StAnny's.