How long would depend on if there were any complications of the surgery, like having had the appendix burst, or post-operatively by an infection. Otherwise, it depends on you and how well you get back on your feet afterwards. Most people with a normal recovery get discharged on the 4-5th day post operative. The sooner you get up out of bed and moving, the sooner you get out. While in the recovery room, they will want to see you can go to the bathroom. Inside the first 12 hours they should get you up on your feet, to try to walk a bit- and a good nurse will force the issue if needed. Your diet the first day will be liquid, and will progress to a bland diet as you recover and can tolerate the food. The outer stitches can come out on the 4th or 5th day (or staples, if used), and at that point you are usually let go home if you are not running fever, can eat, move around, and go to the bathroom.
If you have complications afterwards, that will add time to the hospital stay. An infection will keep you in until it is under control, which can take another week. If your appendix burst, you would be in for at least 7-10 days, on antibiotics to combat the infection. Anemia due to blood loss would add time as well, until the tests showed you had improved. If you simply lay in bed unless the nurses force you to get up and move you will also add days to the stay. But for most folks, about 5 days is usual.
I had mine out in 1991, and I was released the morning of the 4th day. I had no complications and was up on my feet within an hour of waking in recovery. I forced myself to walk and sit up, because I knew it would help me recover. By the end of the first week, I was moving slowly but comfortably for the most part, and by the end of the second week I was back pretty much completely. I put vitamin E gel on the scar line, and it healed nicely in about that same time- though it did stay sensitive for a while afterwards to rubbing from waistbands.