Titles are assigned by the writers of the episode, normally during the writing stage, and long before filming takes place. The titles normally appear in listings magazines, on the internet, sky EPG etc. so it's easy to find out what they are.
www.epguides.com is a good site for episode titles past and present (and future).
For some series, for whatever reason, the writers seem not to have come up with episode titles, or no official ones were ever indicated - Sapphire & Steel being a prime example. In this case, the fans made up their own 'unofficial' ones to compensate.
it would be helpful if they listed the titles on screen. It would be even more useful if they credited the music they used during programmes, but that's a rant for another day!