As far as “Tel Avivim” are concerned, there is no reason to leave the city, but if you do want to get to Jerusalem and visit it, as well – it’s pretty simple. Buses run every few minutes starting from 6am till midnight from the Central Bus Station (bus number 405 from platform 607 on the 6th floor) or from the Arlozorov Terminal on Namir Rd. (נמיר), which is more central (bus number 480 from platform 2). These would take you about 50 minutes, and get to the Central Bus Station in Jerusalem.
Trains run from Tel Aviv to Jerusalem, as well, but they take much longer, cost more, and don’t really take you to the centre of Jerusalem. Note that public transport doesn’t operate from Friday late afternoon (~5pm) till Saturday night (~8pm). You can though use shared taxis – “sherut” – that leave from just outside the Central Bus Station on Tzemach David St. (צמח דוד).
If you’re here with a car – Highway 1 will take you straight to Jerusalem in 40-50 minutes. You can get to that from Road 20 (Ayalon, איילון). So going for a day trip in Jerusalem is perfectly doable, just don’t forget to come back to Tel Aviv!