I would like to know if the phrase 'in the end of 17th century' is grammatically correct?
No. You could say, 'towards the end of the 17th century' or 'at the end of..'
Is the phrase equivalent to 'in the late 17th century'?
Nearly. 'in the late 17th century' places it roughly any time 1680 onwards. 'At the end' would imply any year 1690 onwards, and 'towards the end' would imply roughly 1685 -1690, perhaps even 1685-1695
I wonder if this sentence is correct, 'I never speak to him again for months'?
Personally, i think the sentence is a bit odd. Is there another way of saying it?
You could say:
I stopped speaking to him months ago.