Assuming that all of your yarn is the same thickness and is shrinks the same amount in the wash (best achieved by buying the same brand of yarn for each color), the reason that your piece "shrinks" is most likely because there is not enough slack in the yarn you carry from one section to another to spread across the distance between each usage of that particular color.
It is easier to find information and illustrative images for knitting, so I will use those, but the concepts are the same for both knitting and crochet. When your piece has individual patches of color surrounded by other colors, it is called "intarsia." If you have multiple colors interspersed throughout the piece, that is called "stranded" work.
Here is an example of a knitted piece made with intarsia:
If you look closely, the person has worked the pink yarn across to where the tan begins, then s/he has worked the tan yarn for however many stitches, and then restarted with a new source of pink yarn. When you are working this way, you end up with a bunch of long ends of yarn hanging from the back of your piece waiting until you get back to where you are ready to use them again. Frequently, this yarn will be wound around a bobbin to allow you to unravel just enough yarn to be able to work that section and then shorten the length again to avoid tangling.
I like this type of bobbin best
but you can also use this type
If you are working a stranded piece, then you won't stop and start the colors, but will carry them across the reverse side of your piece until you are ready to use them again.
Here's an example of a stranded piece:
You can see, at the bottom, how there are strands of the white yarn that are being carried along at the back of the piece across the span of two or three stitches. Not leaving enough slack in these strands is what will cause your piece to shrink or pucker.
The rule of thumb for stranded pieces is not to carry your yarn across more than three stitches (and I often reduce this to two stitches) before tacking it down somehow. This allows you to have better control and ensure that you have enough slack to keep the final piece even. The way you "tack" the yarn is, before starting the next stitch, move your active yarn to the reverse side of the work, below the stranded yarn, then wrap it around the strand so that the active yarn is now above the strand and then work your next stitch. This will form a little loop around the stranded yarn and will hold it in place.
Even when doing the wrapping process, any time you strand across too long a section of your piece, you run the risk of causing pull-in or puckering. So, in general, when I am faced with stranding across more than about 5-6 stitches, I will usually consider working that section in intarsia.
If you need more help, try googling "stranded crochet" or "crochet intarsia." I saw quite a few good resources with both searches.
As @willeke pointed out, knitting and crochet are worked differently. So, here is an image of how to carry yarn and wrap yarn in crochet from this article. The concept is the same, except that you will lay the stranded yarn along the top of the crochet stitches that you are working, instead of behind the work, like you do in knitting. You still want to make sure and wrap every two or three stitches.