The sun, while yes essential for life as we know it, is a mixed bag because that means more potential sun damage to your skin. How much sun do you really need in a day to get enough Vitamin D naturally but avoid a burn? Well that depends on your skin type and the UV index du jour.
Check out your Fitzpatrick Skin Type first. Once you figure that out, you can find out what the UV index is throughout the day and then look at the matrix here to find out how long you should spend in the sun to get your daily dose of Vitamin D.