Hi there!
The difference between the 14 and 21 day pass is ¥12,600, so you'll need to spend that on JR tickets outside of the 14 day period to make upgrading to a 21 day pass worthwhile.
Looking at your itinerary, whichever way you cut it you'll be doing fairly long distances outside of a 14 day period as you're leaving Tokyo on the 31st and returning on the 15th. If we assume that you'll do the longest distance travel with a 14 day JR Pass, this means that you'll be using the jrpass from the 31st-13th, leaving your Tokyo/Nikko/Yokohama/Kamakura trips remaning and also the trip from Takayama back to Tokyo and Narita. Here are the JR costs for these elements:
-
Tokyo > Nikko: ¥5,230 (121mins, 150km)
-
Nikko > Tokyo: ¥5,230 (121mins, 150km)
-
Tokyo > Yokohama: ¥1,460 (23mins, 28km)
-
Yokohama > Tokyo: ¥1,460 (23mins, 28km)
-
Tokyo > Kamakura: ¥1,700 (48mins, 51km)
-
Kamakura > Tokyo: ¥1,700 (48mins, 51km)
-
Takayama > Tokyo: ¥14,300 (273mins, 532km)
-
Tokyo > Narita airport terminal 1: ¥3,140 (58mins, 79km)
As you can see the total cost for these extra tickets will be far more than the cost of upgrading to a 21 day pass so I highly recommend going for the 21 day option.
You can make good use of the JR Pass around Tokyo (here's a map of JR lines in Tokyo for reference), but will get less use in other cities so you should expect to budget for some metro travel (¥100-150 per trip). If you think you'll do a lot of travel in Tokyo I recommend you look into the 1 or 2 day unlimited metro passes which are only available to foreign tourists at Narita and are great value. You can also pick up Kyoto bus day passes and so on when you arrive at other cities. Most large JR station have a tourist information desk so I recommend you ask about metro discounts here when you arrive.
If you want to get an overview of the JR Pass coverage throughout your trip I recommend you consult our zoomable interactive map which lets you explore all 4808 stations. I have marked all your JR stations on the map for your convenience, it's quite a trip! :)
I hope this helps!