Even though they are both situated in the Vatican City, St. Peter's basilica does not constitute part of the Vatican Museums. Unlike the Museums, the basilica is free to enter and you don't require a ticket to get in. That being said, the entrance lines snaking across the square outside can be very long.