Here is the definition of Sylow $p$-group (source: wikipedia)
For a prime number $p$, a Sylow $p$-subgroup of a group $G$ is a maximal $p$-subgroup of $G$, i.e. a subgroup of $G$ that is a $p$-group (so that the order of every group element is a power of $p$) that is not a proper subgroup of any other $p$-subgroup of $G$.
Also here is the definition of a maximal subgroup (source: wikipedia)
In group theory, a maximal subgroup $H$ of a group $G$ is a proper subgroup, such that no proper subgroup $K$ contains $H$ strictly.
So, in accordance with the definition of maximal subgroup, a maximal $p$-subgroup $H$ should be a proper $p$-subgroup of the group $G$ such that no other proper $p$-subgroup $K$ contains $H$ strictly.
But the definition of Sylow $p$-subgroup does not say that it is a proper subgroup of the group $G$. According to its definition, if say, $G$ is a group of order $2^3$, then the Sylow $p$-subgroup is the group itself, but if I follow the definition as given by me, the Sylow $p$-subgroup should be a proper subgroup of $G$ i.e. a subgroup of order $2^2$.
I know I am misunderstanding the definition somewhere. Please help me rectify myself.
As I mentioned in comments, I think the issue here is actually that we misname "maximal subgroup".
Of course, given a partially ordered set $P$, a maximal element (or $P$) is an element $p\in P$ with the property that for all $x\in P$, if $p\leq x$ then $p=x$.
If we have a class $\mathfrak{X}$ of subgroups, partially ordered by inclusion, we often talk about "maximal $\mathfrak{X}$-subgroups" (also "minimal $\mathfrak{X}$-groups", though that is less common). Thus, "maximal $p$-subgroup" means "maximal among the $p$-subgroups".
We say "maximal subgroup" (and "maximal normal subgroup"), but we really mean "maximal proper subgroup" (that is, the class $\mathfrak{X}$ is the class of proper subgroups, not the class of all subgroups). (And we likewise really mean "maximal proper normal subgroup").
So we should say:
If we used that terminology and definition, you would likely have no problems. But it is an unfortunate fact that nobody says "maximal proper subgroup", we just say "maximal subgroup" and elide the "proper" clause, on the (flimsy) excuse that of course we must mean proper subgroup, as otherwise the concept would just be "the group $G$" and it would be silly to introduce such a nomenclature for the whole group.