It never ceases to amaze me just how rude some people can be to others. It's even worse when the person being rude is someone close - a good friend, a family member, etc.
Your dad shouldn't have called you stupid or any of the other hurtful things he said. I understand that when you have a condition such as depression, taking criticism can be extra hard. Don't let him or anyone else beat you down or ruin your self-image though. You are absolutely NOT stupid.
Math can be very challenging - especially if you're getting into things like algebra, line slopes, etc. Some people "get it" and catch on quicker than others. Some people just really hate math and don't do well at it. There's no harm with that at all and it's perfectly acceptable to ask for help if you need it. If you dad didn't you for some reason, he should have just said so, so that you could have found someone else to help you. If all else fails and you do need some extra help, try talking to your math teacher at school. Let them know where you're having some trouble and I'm sure they will help you. If you have a fellow student you like and feel comfortable with in your math class, ask them if they could help you. Believe it or not, you can actually teach yourself too. Think about where you're having the most trouble. Then, practice as much as you can. You can even use the internet for more practice problems or check out extra math books from your local library. The key to math is paying close attention to the question/problem. Make note of any/all important information you're given. Truly think about it before you just guess and decide on an answer. Read the entire question/problem, then look at the answers. Then go back and re-read the problem. You can also glance down at the answers and read them first, then read the problem carefully. A lot of times, you can easily see at least one answer that clearly does not make any sense and definitely isn't correct. If that's the case, there's one answer you can positively remove as a potential choice - then you have less options, making it that much easier to find the true correct answer.
Good luck and don't worry about what you heard. You are not a stupid or worthless individual. You are smart in your own way and having math be a "weak subject" is far from the worst thing. MANY people struggle with math, so you aren't alone either. Always remember your value and self-worth and don't let others wreck your self-esteem with the cruel things they choose to say to or about you.