A friend of mine told me that - according to many British grammar books - for an uncountable noun in a negative sentence, 'much' should be used instead of 'a lot of'. But I have seen both used interchangeably. Could you please shed some light?

In fact, I tried using Google search engine with 'site:nytimes.com "I don't have a lot of time"' vs. 'site:nytimes.com "I don't have much time"'; the result was bias toward the former:

"I don't have a lot of time" - > 36,000 hits
"I don't have much time" - ~ 3,000 hits

I see nothing wrong with I don't have a lot of time.

There is indeed some conflict between what prescriptive grammars tell us and what you'll actually encounter in text and speech concerning the 'correct' use of the quantity determiners 'much' and 'a lot of'. Logically, if we loosely define 'much' as meaning 'a lot of' (when used with non-count nouns), then there's no reason why they shouldn't be freely interchangeable, at least grammatically speaking. Generally, though, it's often just a matter of style, 'much' being perceived as the more elegant of the two, especially in negative clauses.

It's interesting, though, to contrast positive sentences (where 'a lot of' often sounds better) with negatives (where it usually doesn't). For example, compare the positive "We had much rain last night" with "We had a lot of rain last night" which strikes me as much better. But in the negative equivalents "We didn't have much rain last night" sounds (arguably) slightly better than "We didn't have a lot of rain last night".

But it's not a hard and fast rule with negatives. For example, the informal "I don't want a lot of cheek from you" sounds much better to me than "I don't want much cheek from you".

Perhaps it's all a case of "much ado about a lot!"