Betta fish should not be kept in direct sunlight. Direct sun can rapidly overheat the water, causing dangerous temperature swings that may stress or kill the fish.
Sunlight also promotes algae growth, which clouds the water and competes with the fish for oxygen. Prolonged UV exposure can damage a betta's skin and eyes.
If you want natural light, place the tank where it receives filtered, indirect sunlight. Better yet, keep it in a shaded area and use a quality aquarium light designed for bettas.