It depends. I'm currently grown some philodendron vines in water for propagation purposes. They will stay in water for a long time with no ill effect. However, I believe that all the plants growing is coming from it's own energy stores. Eventually those will run out.
You'll need to replace those. Whether that's in dirt or water is up to you. I'm sure you can keep it in the water, since that would be aquaponics, but you'd definitely have to add nutrients to the water and make sure they stayed balance. Also, with aquaponics, you often have to put an air bubbler in the bottom so that oxygen is getting to the roots. If not, it's like taking a potted plant with no drain holes and filling it up with water. The roots will rot.
So the answer is no, you don't have to take it out of the water, but the effort and money it might take to set it up for long term sustainability might not be worth it when you can pop it into a pot with some soil.
However, celery is cheap. I suggest you buy a bundle of it and pop a cut off stalk in multiple jars of water. Set them up differently. Maybe three in straight water, three in water that has miracle grow fertilizer mixed in, and three that you pop into different types of media you keep wet. It could be sphagnum moss and perlite, miracle grow, and clay hydro balls. Just set up an experiment with different variables to test. Take notes and take pictures. I'd be interested to see what you come up with. Also, light intensity would be something cool to play with. You could have one from each group by a window sill, by natural light, but with a lamp nearby, and just with a 6500k daylight bulb in a lamp. Good luck, I hope this answered your question.