Joshua Tree is an incredible desert oasis full of wonderful hike trails, stunning views, and delicious food. If you're in the LA area, it's the perfect weekend getaway and I love visiting whenever I want a bit of R&R.
Stargazing is a popular thing to do at Joshua Tree so I would plan your visit around the moon cycle, if possible. A full moon is not great if you want to see The Milky Way so just be conscious of that. Also, every year there's a Night Sky Festival held in the area – it's awesome to check out and worth planning a weekend around.
One cool thing to know is that the Joshua Tree National Park is actually made up of two distinct desert ecosystems, the Mojave and the Colorado, so the scenery out there is super unique.
When deciding how long to visit, 2 - 3 days is usually long enough to hike the trails in Joshua Tree, visit art galleries, and pop over to neighboring Palm Springs.