Just for a quick reference, you earn one mile for every mile you fly. Flying round-trip from Chicago to San Francisco is about 3,700 miles. You can also earn bonus miles by getting credit cards, flying 25,000+ miles a year, and signing up for occasional special offers.
It takes 25,000 miles to book a free coach ticket within the US and Canada. However, there are very few seats available at this "saver" price. It takes 50,000 miles for a "standard" award, where you're guaranteed a seat as long as there are still some for sale. Saver tickets to Europe are 55,000 miles, and getting to most of Asia takes 65,000. All of this can be found here:
http://www.united.com/page/article/0,6722,1142,00.html and
http://www.united.com/page/article/0,6722,59,00.html (you have to scroll down to see the charts).