I am not sure about UCP wikis because I was under the impression that UCP wikis didn't allow custom background images yet. However, for legacy wikis, the image must be at least 2000px wide.
There isn't a simple formula for converting from image size to file size. The file size is determined by more than just the number of pixels. Some images contain meta data such as (but not limited to) when it was taken and the coordinates (geolocation) where it was taken. In addition most images contain meta data so that programs can identify what type of image it is and how the rest of the data is encoded. All meta data contributes to the file size and does not necessarily correspond to the number of pixels.
Additionally, how the pixel data is stored will also impact the file size. Most formats use compression. Image compression is a method of representing the entire image without needing to store the value of each pixel individually. Because there are different ways to do it, the file size will depend on the compression algorithm that was uses as well as the compression level. You can always force an image to a higher compression level but then you risk loosing the color or resolution of the image.
In short, the file size depends not only in the image size but on the meta data, compression method, and compression level. Therefore, it is not possible to convert a file size limit into an image size limit without knowing everything else as well.
Also about "fill the entire background so that there is no, to little tiling" - note that there are different screen sizes, different zoom definitions, and even different proportions between the width and the height of the screen/window. Therefore, it's not possible to create an image that will fit exactly to everyone's screen. If the image fits a certain proportion, then it won't fit another proportion, and it will must be either cropped, streched, tiled, or fitted in without filling the entire size.