The Japan Railways Keihin-Tohoku line takes about 40 minutes from Tokyo to Sakuragi-cho Station in Yokohama; the faster shinkansen leaves you off at Shin-Yokohama, on the outskirts of the city.
It takes 40 minutes to go from Tokyo to Yokohama.