Yes that's right. The total weight of an airplane determines how high it can fly. That total weight includes the plane itself, the number of passengers, the luggage and the fuel. As the plane uses fuel, the total weight starts to go down. The more fuel it burns, the higher it will be able to go. If you listen regularly to ATC communications, you will sometimes hear ATC ask a plane if it can go higher. Sometimes they will answer 'yes' but other times they will say 'no' because they are still too heavy.