I believe the answer, at least in the US is 20 hours of flight time, plus however long a checkride takes. A sport pilot can carry a single passenger and the minimum requirements are outlined in 14 CFR §61.313:
If you are applying for a sport pilot certificate with [...]
Airplane category and single-engine land or sea class privileges,
Then you must log at least [...]
20 hours of flight time, including at least 15 hours of flight training from an authorized instructor in a single-engine airplane and at least 5 hours of solo flight training in the areas of operation listed in §61.311,
If a sport pilot applicant logged exactly 20 hours, got signed off, and then passed their checkride on the first attempt... they would be able to fly passengers as soon as they completed the checkride. That means, realistically, probably 21 to 21.5 hours.