I have my Nikon D7500 set to Manual Mode. I can change the shutter speed and it maintains the setting. When I change the aperture, the setting is not maintained and varies depending on the zoom of the lens. How do I stop the aperture from changing when in Manual Mode?
Many lower-cost (or even more expensive but high zoom-ratio) lenses do not have a constant maximum aperture. They are constructed so that they have as wide as possible aperture when zoomed out, but the design compromises in their construction mean they are limited to narrower apertures when zoomed in.
I expect that's what's happening here: you have an aperture set which your lens provides at a wider zoom but which is not physically available when zoomed in, so it's doing the best it can.
If this is the case, your lens will have a designation like
18-140mm f/3.5-5.6G. The "G" is a Nikon thing (and irrelevant here), but the other numbers are typical for all makes of lens. The first is the range of focal lengths in millimeters, and the second, f/3.5 to f/5.6, is the maximum available focal length at each end of the range. In between, of course, the limits will be somewhere... in between.