业余时间is confirmed in a time,ex,you work in weekday from 9:00am to 6:00pm,so the 业余时间 is weekend and 6:00pm-8:00am next day of weekday。
有空的时候:① is a break,it can happen when you are working or you are off.
ex,although you are working, you are not busy,you can see 我现在有空。
although you are off on weekend you have to study Chinese,so the weekend is not availabe to shopping or hang out with friends. 周末我没空。
②有空的时候can be short can be long。
2:00-3:00我有空。我只这半个小时有空。我整个5月都有空。or just few minutes。——现在有空吗?——现在有空。maybe i‘m busy after 5 minutes。