On a new bike yes, the cable has probably stretched. If you're not familiar with fiddling with indexing I'll try a short explainer.
If you have the older style Deore there will be a cable adjuster on the derailer where the housing ends. Put your bike in the middle cog (5th gear on a 9-speed). Is the pulley directly under that cog? You can turn the adjuster counterclockwise to move it leftward, towards the bigger cogs; clockwise to move right, closer to the smaller cogs. Shift up and down the cassette, you'll probably need to do this a few times until the indexing is correct.
If it's a newer Deore without the adjuster on the derailer you can use the one at the shifter. Which I find super annoying so I don't buy those kind so I don't know which way to turn it, but you'll figure it out after a few turns this way and that. Good luck!