I would use commas between each component, and use "and" only if the last component is seconds. I learned way back in intermediate school that "and" is only used before fractions (so 10,247 is said "ten thousand, two hundred forty-seven" but 10 7/8 is said "ten and seven-eighths"). I would call seconds the smallest "lay person" time interval — if you're getting into fractions of a second, you've moved beyond regular timekeeping and are now talking science, so it would be formatted differently.
So using your example:
The maximum time period allowed is 365 days, 23 hours, 59 minutes, and 59 seconds, so any longer than that is a problem.
BUT if your time were shorter, it would be written:
The maximum time period allowed is 365 days, 23 hours, 59 minutes, so any longer than that is a problem.