Your neck doesn't do any heavy lifting. Your neck positions your head in space and serves as an anchor for muscles of the jaw, shoulder, and arm. The other day I was in a gym and saw a guy, probably around 30, bent over a bench, hands supporting him on the bench, with a strap on his head with some weights on the end of it. His face was twisted into something like the Joker as he fought the downward pull of the weight. Maybe if you play college or pro football or fight in the Mixed Martial Arts arena this has a place in your routine although I would argue that there are better and safer ways to strengthen your neck. For the person who has chronic neck pain, don't ever do this drill or anything like it.
If you have joint weakness (so, think of Degenerative Joint Disease, Disc Disease, Disc Herniation) and your neck feels stiff, tight, or aches, usually what you need to do first and likely insert as part of your lifestyle, are joint conditioning drills. The good news is that for the neck all you need is a small beach ball and a little space on the floor. You can read more about how to do this here.
The trapezius muscle is the large muscle that runs from your spine to your shoulder and shoulder blade (scapula). It is often a site of "neck pain" even though it's not actually your neck. People who perform long duration activities, like working on a computer, often develop pain in this area.
People do all sorts of things for this kind of neck pain: massage, Rolfing, ice,
heat, neck exercise, and drugs among others. And lots of these things
seem to reduce the pain but there's a type of exercise that is
sometimes overlooked that has a direct effect on how long and how often
you have this sort neck pain.
Your arm is equal to about 5% of your body weight. So, for a 150 lb person, that's 7.5 lbs or 15 lbs for both arms, pulling on your neck. As you sit at a desk typing away, your neck is resisting the downward tug of 15 lbs - a good size bowling ball. You need really good muscle endurance to withstand that day after day.
There have been a few studies that have looked at muscle endurance of
the upper shoulder area in people with chronic neck / trapezius pain and the
consistent finding is that people with this sort of neck pain have low endurance of the trapezius muscle. In other words, the muscle runs out of gas quickly. When muscles run out of energy, they hurt. Sometimes muscles will cramp, spasm, or just feel tight.
You can make ergonomic adjustments to your work area - get your keyboard monitor at the right height, make sure your sitting posture is correct, etc., - and these things will help but to really feel good both during your work day and after, you'll want to increase the trapezius muscle endurance.
The trapezius muscle has three parts - upper, middle, and lower. It shrugs your shoulder, pulls
your shoulder blade back and also helps rotate the shoulder blade as you lift your arm. A simple exercise to increase the endurance of this muscle is this:
Lift your arms up until they are parallel to the floor.
Now, bend your elbows 90 degrees (palms facing down).
Shrug your shoulders just a little.
Now hold your arms in this position for as long as you can.
Stop the timer when you feel you can no longer hold the position or if you have any pain (you may get tired in your shoulders, neck, or both).
Record the time.
Take 70% of the time as your training time. So, if you held the position for one minute, use 42 seconds as your training time (60 seconds x .70 - 42 seconds).
Rest two minutes before performing the exercise.
Using 42 seconds as your time, repeat the exercise. Do five sets. Rest one minute between sets.
After you have done this for a week, re-test.
Once you're up to three minutes, instead of using a bent elbow position, straighten the elbow and repeat the entire process (test, calculate 70%, train).
As your muscles fatigue, your posture may change slightly. Pay attention to this. When this happens, adjust your posture back to the tall position. If you can't maintain it, stop. Don't be dismayed if you find your test time to be 30 seconds or less. It is what it is. You can change it. Eventually, you'll find three minutes not all that fatiguing which means it's time to do other drills.
Some neck pain is not actually in your neck but in the shoulder muscles. Try working on your shoulder endurance to improve your overall neck performance.