You probably need to move it to a larger container. I would be willing to bet that it's very root bound. Cucumbers need a container about 20" in diameter and 16" deep, plus you will need to provide a trellis for the plant to climb on.
Put your tomato plant in a separate container. The same size as for the cucumber plant would work best, but you can get by with a standard 5-gallon bucket if you have to. Punch drainage holes in the bottom, if you decide to use the bucket.
Use a good potting soil mix, not a garden soil. Add a healthy helping of perlite, to improve the drainage. About 3 parts potting mix to 1 part perlite would be good. You can add some worm castings, if you have them available.
HTH!

"Isn't it enough to see that a garden is beautiful without having to believe that there are fairies at the bottom of it too?" - Douglas Adams