It is GRAMMATICALLY correct, but it's not a very good sentence.
It's a little better like this:
"We shouldn't have been talking about this topic for SO MANY hours"
This implies that you have been talking about something for a long time, and are STILL talking about it but you want to end the conversation. If that isn't what you mean, you probably need a different sentence. It's difficult to tell without knowing some context.