Is doing your homework on Sunday a sin? Mortal sin?I think it depends on the degree in which you have sufficiently made the Sabbath day holy. Any mundane chore or other form of work can be done as a gift to the Lord --even homework. So, if you have sufficiently made the day holy by going to Mass, spending some time in prayer, perhaps doing some spiritual reading (of the Bible, or a theological/mystical book of some kind), etc., then doing your homework could be a part of that. When you do it, you would want to give it your best, remain diligent in doing it, and keep in mind that you are trying to glorify God in how you work on this endeavor.
Of course, that isn't exactly easy, especially since most people hate doing their homework and it's difficult to see it as ever being a gift to the Lord. If that describes you, then you should perhaps try to do your homework on Friday or Saturday. Unfortunately, the notion of the "weekend" has caused Sunday to lose some of its sanctified status, and many people actually dread Sunday because it means that you have to go back to work tomorrow or finally sit down and do that homework you have been putting off until the last minute. If you do your homework before Sunday, then you are less likely to dread Sunday and more likely to give it the dignity that it deserves as the day when Jesus Christ rose from the dead.
Not keeping the Sabbath day holy is a grave sin, so you must keep this in mind when you are scheduling time to do your homework.