It varies from person to person and with latitude, cloud cover, seasonal angle towards the sun etc., byt for the sake of simplicity, a few hours a day barring any other source of vitamin D.
humans evolved to be able to store vitamin D from sun exposure so the nice thing is you can get a few hours of sun and then go many weeks without it and still be good to go
and PON is absolutely right. if you live in north europe or alaska you aren't gonna get much as the sun is much lower on the horizon.. hell during the winter they barely have sun at all, but we know that their genetics have evolved where they need way less than someone who came from Africa for example. let's say you were african and moved to alaska you better find a spa that has an infrared sauna or you will be fucked
Even people who live in sunny areas can develop vitamin d deficiency so it's not a guarantee by no means that you will be getting enough of it just from the sun.
It can, kinda obvs, vary from individual to individual. Clothes, hats, skin tone and so on will all make a difference. You'd have to live underground or indoors for months to have issues. That and a real bad diet