1.She was happiest when she was with her friends.

2. She was the happiest when she was with her friends.

(Are both the same?)

3. This river is deepest at this point.
4. This river is the deepest at this
point.

(Are both the same? Do we have to use 'the' or not? Thank you.)

1 and 2 are pretty much the same, yes. 1 is better because it doesn't have the extra word, although that extra word doesn't make it incorrect!

3 and 4 mean the same thing, yes. Either one works fine.