If you are published by a publishing company they will take care of the ISBN for you.
If you are self publishing a lot of self publishing companies give you a free ISBN number. However any ISBN you receive without paying the normal rate of $50-$250 usually is registered with the companies name under publisher. i.e. if you receive one through publishing with CreateSpace.
If you are printing books on your own without any kind of publishing service you will need to purchase one. The site that seems to be recommended everywhere is www.isbn.org however I think you may have to buy them in bulk as it is aimed at publishers who buy them in sets of ten.
It is recommended to have a different ISBN for each format you publish your book in. So if you publish your book as both an eBook and print book each should have their own ISBN.