The number has no special meaning. It's just a number the author of the image thingsboard/tb-postgres
picked to use as uid inside the container.
$ docker run --rm -it thingsboard/tb-postgres id
uid=799(thingsboard) gid=799(thingsboard) groups=799(thingsboard)
You do the chown so the user inside the container can write to it.
not really relevant, but to end the discussion in the comment: This is the second layer of the original docker image:
RUN /bin/sh -c apt-get update && apt-get upgrade --yes && apt-get autoremove && apt-get install -y --no-install-recommends procps && apt-get clean && rm -rf /var/lib/apt/lists/* && addgroup --system thingsboard --gid=799 && adduser --quiet --system --uid=799 --ingroup thingsboard --quiet --disabled-login --disabled-password --no-create-home -gecos "Thingsboard application" thingsboard
Highlight by me. The uid/gid are inherited from a base image.