It's easy to tell yourself "I'll just pay for my ticket" and end up with a bill twice as big by the end. The real cost is way more than just admission. You gotta factor in gas to get there (if it's far), parking which can be pricey, and yeah, on-site camping if that's available. But honestly, it's usually your best bet compared to renting a hotel room in the area - a room will easily cost you 150-200$ a night, while camping is like 50-80$ on-site. If you manage to split a camping spot with a few people, it becomes really affordable.
Then there's food and drinks. The restaurants and vendors on-site charge like double the normal price, it's a classic trap. Bring your own snacks and supplies if it's allowed, otherwise be prepared to spend a decent amount. Personally I'd say a full weekend per person, it's realistic to budget between 400-600$ total if you're splitting costs (ticket + camping + food + gas), unless there's a bunch of you in the same car and the same tent spot. It depends on the festival too - the big ones like Osheaga are generally a bit pricier than the smaller ones.