Let's say that after making an attack with my lance by stabbing it into an enemy, I leave the lance there (stab it into the enemy and just let go). Is this considered dropping the lance? And as such, am I able to take out my longsword and attack with it (Fighter lvl 6 has the Extra Attack class feature).
There are no rules (to my knowledge) that govern what happens if you let go of a weapon after an attack; as far as I know, you'd simply drop it to the ground.
If you are of a class that has the Extra Attack feature and are high enough level to make multiple attacks as part of your Attack action, then it would be possible to attack with one weapon, drop it, then draw another weapon and make your additional attack(s) from the Extra Attack feature.
You would have to make your first attack with an already-drawn lance (note that if you attack with a lance, you do so at disadvantage if the target is within 5 feet of you), drop/let go of the lance, use your free object interaction for the turn (not a bonus action) to draw the longsword, and then attack with it.
This Sage Advice confirms that you can use different weapons for the multiple attacks granted by the Extra Attack feature, as does this one. It's also confirmed in the Sage Advice Compendium:
When you use Extra Attack, do you have to use the same weapon for all the attacks?
Extra Attack imposes no limitation on what you use for the attacks. You can use regular weapons, improvised weapons, unarmed strikes, or a combination of these options for the attacks.
Yes, but reach and mounted movement may make this hard
It has been clarified in Sage Advice that "letting go of something requires no appreciable effort," so you would be able to draw a weapon and attack again, presuming you hadn't already interacted with an item this round.
However, since you're attacking with a lance, I need to point out that the rules for mounted combat could get in your way here. Since lances give you disadvantage to attack creatures within 5' of you (PHB, p. 148), I assume you were attacking a creature 10' away. If you were mounted (which isn't certain, but is often the way a lance is used), note that there is disagreement about whether mounts and riders share a turn.
A recent sage advice on the matter indicates that:
Jeremy Crawford: A rider and a controlled mount have separate turns, but they have the same initiative, which means you decide which one goes first.
If your DM is using this version of mounted combat, then if you find yourself 10' away from an enemy, mounted, and with an "Extra attack" still remaining, you could not move your mount forward and then attack: by moving your mount, you are declaring the end of your turn (and the start of its turn). So although you'd still have an "interact with an object" action left to draw the sword, and an Extra Attack left to attack with it, you may have to dismount and approach on foot to actually do so (or throw the sword).