There is no one optimal amount of sunlight. It depends on location, season, time of day, skin color, weight, dietary vitD intake, etc.
There are calculators online that can give a decent indication. Also you don't need optimal levels every day. It's fine to get more vitD one week and less in the next week.