Stretching along the frets is relatively straightforward. This exercise can be practised sticky to make it a little more demanding, but perhaps to start, just hover your fingers before they are played.
Very important though is to stop if your hand starts to hurt, hands are fragile and sensitive things and too much, too soon can cause damage. So, a little at a time is best, which goes for all practising, don’t overdo it. Segovia broke up his practice time and went for numerous walks throughout the day in-between sessions to give his hands a rest, sound practice. Warming up is also advisable, perhaps with something not too demanding on the fingers. A stretching exercise exists to reduce over-stressing the hand whilst playing a piece, it would be ironic if the exercise resulted in an injury hindering the ability to play comfortably.
Ultimately, we want our hand to move freely (without much effort) along the fingerboard without any pain, enabling us to focus on creating beautiful music.