I got a whole Shimano Deore groupset 3 x 10 and would like to upgrade my good old Trek bike. Do I need to change the whole rear wheel now? It has currently Sunrace Megadrive Lock Ring Type cassette or rather a freewheel. And if I need a new wheel, what should I get so that it lasts?
You'll need to:
Maybe respace the rear dropouts, depending on the age of the frame. Modern wheels are wider than older wheels. For reference, 7 speed road is 126 mm, 7 speed mountain is 130 mm, 10 speed road is 130 mm and 10 speed mountain is 135 mm. Note that your frame needs to be steel for respacing to work -- if it isn't steel, you risk frame failure.
Get a new wheel -- something which has a Shimano-compatible 10/11 speed freehub (11 speed will also work with 10 speed). You could just buy the hub and rebuild your existing wheel with it, but you need a hub designed for the same number of spokes, likely all new spokes of the new correct lengths, and someone whose got experience doing it. Overall, in cost and reliability, getting a new wheel is probably a better bet.