There are a total of 6 locations where Ellie will tell jokes. The video by PS5Trophies does an excellent job explaining where they are:
Chapters
#1 0:00 Pittsburgh - Alone and Forsaken (Blue Bus)
#2 2:02 Pittsburgh - Alone and Forsaken (Book Store)
#3 3:02 Pittsburgh - Alone and Forsaken (Street)
#4 4:37 Pittsburgh - Hotel Lobby (I personally needed the safe open in this lobby before the joke would trigger. It's 22-10-56 and it's in the lower level on the right hand side behind the service counter)
#5 5:40 The Suburbs
#6 7:26 Left Behind - Fun and Games
One thing to note, you'll want to be patient until Ellie completely finishes talking. I made the mistake of walking away too soon and ended up having to backtrack a bit.