I'm sorry to see that no one has responded to your question earlier. Different experts come online at various times; I just came online and saw your question.
Yes, it's safe to have both lights on at the same time, and that's how it's best to handle it. however, I wouldn't follow the advice to have the UVB light on when the sun is out, and off when it isn't. If you live in the tropics where the day length is uniform all year round, that will work, but in most areas, it won't. During Northern winter hours, the sun may only be out 8 hours, and that is not enough UVB exposure for a turtle. The lights should be on for 12 to 14 hours per day, year round. The basking light primarily provides heat, and it's all right for the temperature to fall at night.
I think you may be concerned with overheating the turtle. A UVB light should put out almost no heat. Sometimes pet stores sell people DayGlo, daytime, full- spectrum, UV, or UVA bulbs. those bulbs are NOT the same thing as UVB, so make sure you were sold the proper lighting. UVB isn't measured in watts, but in output of UVB rays, such as 10.0 or 5.0. For a turtle, you'll want a 10.0.I recommend a Reptisun 10.0 in a straight tube. Coil UVB lights are not reliable and can be harmful to your turtle. UVB bulbs must be replaced every 6 months. They still look fine after that because they are putting out some visible light, but are producing almost no UVB rays at that point.
The basking light provides an area where the turtle can get out of the water, dry off, and bask in very warm light. It's primary purpose is to provide warmth, but it's important to use a digital probe thermometer to accurately measure temperatures. You don't want it too hot or too cold. The ambient air temperature in the tank should be around 75 (24*C) degrees, with the basking area warmer still. You need an ordinary incandescent bulb in the basking light. The basking area should be kept at 85-90 degrees (29 to 32*C). You can adjust the temperature by raising or lowering the light fixture. If your tank is small, set up the basking area at one end - you don't want the entire tank to become too warm. The lights that come with the covers on aquariums are not suitable for turtles. You'll also need a submersible aquarium heater that will keep the water 78-82 degrees (26 to 28*C).
Since you are a new turtle owner, you may want to look at this site for additional information on care and feeding. It is a reputable site.
If you have more questions, just let me know by clicking on REPLY. I hope you enjoy many years with your turtle.