Both these sentences are correct, but they sound very unnatural. In modern everyday English, we very rarely use 'much' in positive statements. Here are some alternatives:
Informal: I spend a lot of time on my homework.
More formal: I spend a great deal of time on my homework.