The first step is to give a look (pun intended) at the retina of most birds eyes, which have a 4th cone type to see UV. Differently than mammals, their cones have an oil drop to better constrain the wavelengths detected and reduce the overlap with other cone types. Also, birds' cone are much more thin than mammalian ones.
However, birds also have some downsides. Mammals perceive contrast better than birds and birds have a pecten inside their eye blocking part of their view creating large blindspots. Their retina have no blood vessels, so this is the reason why they need the pecten.
Also, humans, like all vertebrates have an inverted retina, which means that blood vessels and nerves are in front of the rods and cones instead of behind them. Cephalopods have non-inverted retinas.
Cats have a tapetum lucidum behind the retina to allow them see better in the darkness, but at the expense of decreasing their visual acuity.
As elemtilas said, people who get a surgey of cataract can see some UV. See here for more about that.
Further, even on mammals, reindeers do sees UV light.
For IR vision, that is more complicated. The reason is that since mammals are warm-blooded, they simply glow in the near IR-range, so any receptive cone would be always saturated and blinded. Animals which are able to see some IR are all cold-blooded, mostly are insects, but some cephalopods, crustaceans, molluscs, fishes, amphibians and some snakes do see IR. But no way birds or mammal can do that. Note that altough snakes see IR, they don't use their eyes for that, instead they use their pit organs, as if those are a distinct set of eyes for detecting IR, but with a very poor visual acuity, resolution and contrast. So, to add IR vision, you would need to somehow shield the eye from the body own glow.
So, I think that you could:
Start with a human eye.
Replace the mammal cones and rods by avian ones, including adding the avian UV cone. If you are unable to do this, try to at least introduce the reindeer UV cone.
Make the nerves and blood vessels connect them from behind the cones and rods, instead of in the front of them. This would also allow those cells to collect more light and be better vascularized. Then they could also be cramped more tighter, yielding a sharpen image. Since the much better vascularization also gives those cells more nutrients and oxygen, I think (not sure though) that they would then be able to yield a better contrast and get rid of the need of having either pectens or blindspots.
Make a special tapetum lucidum in the eye that can progressively change from reflective in darkness to opaque black under direct sunlight to make better adaptation for different light conditions beyond what the iris is capable.
Change the IOL in the eye for something that is also transparent in UV, maybe you can get an inspiration from reindeers to keep it compatible with being mammal.
You end up with three layers at the retina. The internal one features rods and cones. The other two are (a) the blood vesses, nerve endings and retinal ganglion cells and (b) the tapetum lucidum. Not sure which one would work best as being the middle layer.
Adding a UV cone might have a few downsides. Notably, if you add a new type of cone in the retina, you will need to spread the existing ones a bit to make room for the new ones, which might reduce visual acuity. Also, human eyes focus images with the red and green cones while the blue ones suffer from chromatic aberration and due to them being far less numerous, poor visual acuity in the blue. However, it shouldn't be very hard to balance this, specially if you use avian cones which are much thiner than mammalian ones. Also, the human brain already does a pretty good job "photoshopping" the image from retina to compensate for a lot of the vision shortcomings.
Then when the same 16 light-sensitive receptors appear, we can distinguish hundreds of millions of colors, or even several billion!
Unlikely to work as you think. It is probable that seeing so many colors would require the correspondent neuron wiring in the brain. So, altough some animals have a large number of photo-receptors, this could be at the expense of being unable to properly blend all those color or having trouble to discern different similar shades of the same color or something else. Also, user MJ713 points out in a comment that research on mantis shrimps shows that they are actually fairly bad at distinguishing between similar colors.
About tetrachromacy, I will cite this:
However, the most stringent test of our hypothesis was between the female trichromatic subjects and the female four-photopigment heterozygote subjects. As shown in rows 1 and 2 of Table 2, the mean numbers of bands delineated by the two groups of females (7.6 vs. 10) were significantly different ( p < .01). This comparison eliminated differences in performance attributable to gender and thus was a stronger test of our hypothesis that having four pigments yields a perceptual difference.
At present, four-photopigment female individuals are reported to be rather common, by some estimates occurring in up to 50% of the female population (M. Neitz, Kraft, & J. Neitz, 1998). It is also the case that an estimated 8% of males presumed to be color “normal” likely represent a four-photopigment retinal phenotype (expressing multiple L-pigment opsin gene variants that could significantly contribute to color vision; Sjoberg, M. Neitz, Balding, & J. Neitz, 1998).
I.E. There could be more tetrachromats around us that we might be aware. Even most of the tetrachromats themselves must be unaware.
Also, excelent to read:
Also, some years ago, I seen a paper where someone made an experiment with many women and found out some tetrachromats and even identified two different types of tetrachromats with functional tetrachromacity. If my memory don't betray me, one of those groups had an orange as the 4th primary colour and the other had a greenish-yellow as the 4th primary color. However, it was some years ago and googleing for it I was unable to find it again. This basically happens because the red and the green cones are encoded by two genes called OPN1LW and OPN1MW (ha, could find their names with Google at least), which are neighbours in the X chromosome (but absent in the Y chromosome), so during crossover (for women only), a gene that is a mix of half-OPN1LW and half-OPN1MW might end being produced, and there is more than one way to mix them.
Also, in the same occasion some years ago, I also seen a very good webpage which described in profound details, but still in a clean and easily understandable language, all the nuances of how the color vision evolved and how it worked out in the retina, in the retinal ganglion cells and in the brain. However, once again, Google betrayed me.