Usage varies, as cooking terminology tends to be quite localised. For me, they're both pans. You could call the shallower one a frying pan and the deeper one a saucepan, but they're both still pans. There is also the word "skillet" which is sometimes used to refer to a frying pan, but that wouldn't be understood outside the US. British English uses the term "frying pan". Personally, I wouldn't call anything I put in or on the stove a "pot".
For something (such as lasagna) that's baked in the oven, I'd say 'oven dish.'
By the way, American English also used the word "pan" for the containers used for cake-baking, while British English uses "tin".