There is nothing prohibited from either Jews or Gentiles praying in a synagogue at any time of the day.
Some synagogues are open all day if they have administrative offices or if they have Hebrew school / yeshiva or some other communal activities during the day. I should clarify the distinction between the synagogue as the whole building vs. the synagogue, chapel or service room / area, itself. Offhand, in such places, whether you even could pray there depends on building policy.
Example - my synagogue is a large building that is open all day as there are administrative offices, a yeshiva using some classrooms, and occasional community functions. There is a large "main" synagogue that is open only on Shabbat and Jewish holidays. So, there is no way that they would let anyone even enter that room during the week unless it is specifically for something like maintenance or set-up for Shabbat. However, there is also a smaller downstairs chapel that is always open, and, as long as someone is informed, they usually don't mind anyone praying there during off hours.