For how long should I keep my iPhone in rice?

My phone got wet 2 days ago and it was working perfectly fine, until I put it to charge and my phone kept turning on and off. I put it in recovery mode and put it in a container filled with rice around 7 or 8 pm. I kept it there overnight and its about to 5 pm. Should I take it out now? Or should I leave it in there for longer? If so, how many hours/days?

It can take days for a phone to dry. And the damage may already be done by then.