Excerpt from Security and Permissions "At install time, Android gives each package a distinct Linux user ID. The identity remains constant for the duration of the package's life on that device. On a different device, the same package may have a different UID; what matters is that each package has a distinct UID on a given device."
When installing an app, Android by default(1) creates a UID specifically for that package, so that it can have its private resources / storage space. When no packages are using anymore that UID, the UID is deleted.
So I believe it changes. You can use Pratik's code to checkout and determine the difference after successive installs.
Here is the code for the Package Manager service. Could be a starting point to dig in deep.