From 13 April, patients on acute wards at Princess of Wales, Bridgend, Morriston and Singleton in Swansea and Neath Port Talbot Hospital can have visitors between 11:00 and 20:00 BST, seven days a week.
It is hoped the changes will make it easier for people to visit relatives.
The announcement follows a successful pilot at Neath Port Talbot Hospital.
Cheryl Jones, from Port Talbot, regularly visits her 82-year-old mother Glynis Andrews at Neath hospital and said the new hours meant her mother had lots of company during her eight-week hospital stay.
She said: "It has been really good. I can keep mum company for as long as she likes. It is much better than just having a short visiting time in the evenings."
Abertawe Bro Morgannwg University (ABMU) Health Board said its paediatrics, maternity, mental health, learning disabilities and intensive care wards will also have flexible visiting hours, but they will be based on each patient's needs.
Flexible hospital visiting hours are to be introduced at four hospitals in south Wales.