I have worked on Jeeps as a Mechanic for years, I friend of mine came to me with this same problem of the tail lights (brake lights) intermittently or stop working all together when the headlights are on. Also the blinkers on his did not work. Sometimes it was on the left side sometimes it was on the right. His jeep was an 08 WK limited with the HEMI. There is a few things you need to check before you replace ANYTHING. This does take a certain level of skill and electrical understanding to preform.
1st - check all of your connections as well as the bulbs and the socket that it plugs into, make sure they are making contact.
2nd- Check your wires running from the tail lights, underneath the jeep ( they will run above the spare tire) and on through to the other side. Sometimes they will brake and cause a short.
3rd - This was the last step, I checked the multifunction switch on the steering column and found that it was shorting out. The problem is within the actual switch its self so you will need to replace this in order to correct the problem. This is also a very common problem on WK jeeps, and I have had to replace a lot of them over the years. You must be very careful when replacing these as you do not want to cause any issues with your airbag. Dissconnect the battery for at least 15min before you proceed. The part its self IS VERY SPECIFIC TO YOUR JEEP! so get the part from the dealer or at least get the part number from the dealer. The Part will run between 50-150 depending on year make and model.
If you dont have any brake lights at all or any current flowing to the rear, then check your brake light switch.
I hope that this helps anyone who is having a problem with this! Good Luck!