Without the prepositions, the sentences are either incomplete or ambiguous, or potentially have different meanings.
It's worth noting the strict old-fashioned grammarians say you shouldn't end a clause with a preposition. Following those rules often sounds excessively formal, though sometimes something sounds 'wrong' and sounds better reorganised like that. So, some of your later examples would, according to those rules, become:
The employee doesn't know the tasks to which he is assigned.
This is the friend about whom he can't stop talking.
I say this in case you're dealing with someone who believes in those rules. Dealing with most native speakers, you can generally ignore it.
So, looking at each of your examples, you want to know if you can lose the preposition. Let's see.
We took an interest in what they are having a discussion.
That is incomplete and doesn't make sense. If you're interested in the discussion, rather than the subject of it, you could say:
We took an interest in their discussion.
If you are interested in the subject, it's:
We took an interest in the subject of their discussion.
(You could choose other words than subject)
We don't understand what he is interested.
Again, incomplete and nonsensical. You could rearrange, but you still need to indicate the object of his interest, not the fact of his interest. Or you could rephrase:
We don't understand where his interests lie.
It's putting it a different way, but it has the same meaning.
The employee doesn't know the tasks which he is assigned.
That changes the meaning, flipping object and subject, but it ends up meaning the same thing. The version in your question means the employee is assigned to the tasks, and the version immediately above means the tasks are assigned to the employee.
He drew a picture which students are afraid on the wall.
That's fairly meaningless. There are two possible missing words; either "picture in which" or "afraid of on the wall" - and they mean different things.
This is the friend he can't stop talking.
That looks like there's a missing comma between friend and he, which would mean that 'this' is 'the friend' (presumably previously mentioned), and that said friend can't stop talking.
Pronouns, prepositions, conjunctions - they all matter. Sometimes they can be implicit, but don't assume they can be unless you have reason to be sure.