The main rule to consider is this: Most vegetables need minimally about six hours of direct sunlight. So long as they receive this minimum amount of direct sunlight every day, you can put your garden almost anywhere. Consider, though, that you can never give your warm-weather vegetables (tomatoes, squash, peppers, cucumbers, etc.) too much sun. Cool-weather vegetables (lettuce, greens, cabbage) will tolerate a little shade.
There are a few other placement considerations. Keep your garden bed at least 20 feet away from shallow-rooted trees like elms, maples, and poplars. Not only will the foliage of these trees block out the sun, but also their roots will compete for water and nutrients.
Don’t put your garden in a low area that will collect standing water or near a downspout, where the force from a sudden rain can wash out some of your plants. Do place your garden near a water outlet. By so doing, you will eliminate having to drag a hose long distances. Have a garden shed nearby for tool storage.