I want to get a second cat. I'm thinking of adopting a 5 month old one. My cat is ~2 years old. I know they'll eventually get together but do I have to have 2 litter boxes or will they get things sorted out if I keep it clean?
You should definitely have 2 boxes at first. In fact, you should have 2 of everything: boxes, food dishes, water dishes, beds, etc. Keep the cats separated physically (close one off in a different room if you can) and bring them together slowly, starting with maybe 5 minutes, working up to a few hours, then supervised, then unsupervised once they stop trying to kill each other.
If you adopt from a shelter they should give you info about how to introduce a new cat, but if not, PM me and I can tell you what I've done. I've had many very good experiences with this.
As for after the cats are used to each other, it depends on their personalities. My cats share a box with no problems, but I have friends who have to keep separate ones. If one is dominant and hyperterritorial you might need 2.
Make sure to get both cats fixed; that will avoid a lot of outside-the-box problems.