Shore leave would be granted whenever possible, normally from the end of the work day until start of work next day say 4.30pm to 07.00 if not required for duty.
If onboard a ship, then leave would probably be granted by sections or watches i.e. only a proportion of the ships company could be ashore at any one time. There may have been restrictions on time if the ship were under sailing orders, or in certain ports.
Longer leave (i.e. longer than overnight) was granted on the scale of three weeks leave per year, plus bank holidays. These were usually taken at Christmas and Easter. For ships serving abroad, extra days were added for the length of time served overseas I think at this time it would be a week for every six months. It would mean that when returning from abroad, a rating would have a lot of accumulated leave, which was always looked forward to