The JR Yokosuka Line takes less than one hour and costs 890yen from Tokyo station to Kamakura. It also stops at Kitakamakura Station.
From Shinjuku, direct trains on the JR Shonan- Shinjuku Line require about one hour and cost 890yen to Kamakura. Only trains bound for Zushi, that is roughly every second train on the Shonan Shinjuku Line, provide a direct connection to Kamakura. Otherwise, a transfer of trains is required at Ofuna Station.
JR offers the Kamakura Enoshima Free ticket, which includes the round trip from Tokyo to Kamakura and unlimited travel of local transport in the Kamakura area for 1970yen.
The cheapest way of visiting Kamakura is by Odakyu's Enoshima Kamakura free pass, which includes the round trip from Shinjuku to Kamakura and unlimited usage of the Enoden train for only 1430yen. Note however, that the journey to Kamakura, using this pass, takes at least 90 minutes, compared to about 60 minutes by JR.