First, the Japan Rail Pass CANNOT be purchased in Japan. You must purchase it outside of Japan. The price for the Pass is the same (I believe) but there can be quite a difference in the cost of shipping. My vendor charged a flat $5 fee and it came FedEx express saver (maybe 3 days).
Tokyo to Kyoto is about 2.5 hours by high speed train (Shinkansen). Kyoto to Osaka is less than 30 minutes. Train makes stops but you don't change trains.
This past summer (2017) we used a 3 week pass which covered our entire stay. It saved us a lot of money. It was awesome. It can also be used for travel within cities where there are JR lines. Another plus is that you don't have to figure out how much you have to pay each time you get on the train. You just flash your pass each time you enter and leave.
I purchased our passes from ntaamerica.com