Shutter speed controls the amount of time the camera spends taking a picture, that is, absorbing light. This can be a 1/10000 of a second, or an entire hour depending on the camera capabilities. Long times will capture lots of light; short times will capture a little bit of light.
Shutter speed also affects Motion Blur. A moving object will reflect light at multiple locations during the capture interval, reducing image sharpness. A faster shutter will reduce motion blur.
Motion blur is specially relevant for handheld photography. Camera movement with a slow shutter will cause a lot of camera blur.
But motion blur can also be intentional, using slow shutters to smooth out clouds or water moving in an otherwise still scene. Scene blur is one of the reasons long exposure photography is an interesting technique to learn.
As a general rule, fast moving objects will require higher shutter speeds. If there’s no movement and you’re using a tripod, any shutter speed should work.