I agree with jib71. If you will be in Yokohama first, by all means take the Shinkansen from Shin-Yokohama station to Kyoto station. The fastest Shinkansen is the "Nozomi" which takes about 2 hours. If you are using a Japan Rail Pass (buy it before you arrive in Japan), then use of the Shinkansen is included, but you have to take one of the slower Shinkansens, the "Hikari" or the "Kodama". The "Hikari" takes about 2 1/2 hours.
If you will be visiting Kyoto first, I find the best option is to fly directly into KIX and then take the "Limited Express Haruka" train directly from KIX to Kyoto station. It takes a little over one hour. If you end up flying into NRT, then you can decide if it makes more sense to catch another flight from NRT/HND to KIX/ITM/NGO or take the trains as atchan described. Often the trains are the faster way to go depending on connection times and having to switch airports (NRT to HND for example).