The short answer is yes, like other land mammals the elephant does have knees.
However the popular misconception that the elephant is the only animal which has four knees isn’t quite accurate. What appear to be the elephant’s front knees are in fact its wrists and elbows. Like other four legged animals the elephant has two knees at the back legs and elbows and wrists at the front legs.
The difference comes down to a biological distinction between the bones that the joint connects. Knees connect the thighbone (femur) and the shinbone (tibia) of the leg, whereas a wrist joint connects a forearm and the hand.
Even though we consider most mammals to be four legged, there are important anatomical differences between their back legs and front legs (which have more in common with the arms of bipedal animals). This is the same for elephants, so while they do indeed have knees, they only have two.