Technically, there is no rule. Practically, you want your program to be as organized as possible for ease of future edits. You use the subroutines as a way to break your program up into different bite-sized pieces. So if you're programming a conveyor system that just has a motor and a few sensors, you can do it all on one subroutine. But if you're programming an automation line that has an infeed, three separate steps of production, and then a packaging area, you would split each step up into it's own subroutine.
Personally, for each area of a machine I'm programming, I like to have an INPUTS routine that scans the actual hardware addresses for incoming information (sensors, proxes, button states, etc) and then mirrors those state changes into arrays. Then a CONTROL routine that runs those state changes through the logic using my arrays (not my actual hardware addresses) to decide what needs to change, and finally an OUTPUTS routine that changes the state of all my outgoing channels (motor starters, speed settings, light states, etc). You usually also have FAULTS and ALARMS on their own subroutines, and if you have an HMI that needs logic, that usually has it's own as well.