There's a couple of ways to motivate these concepts. I'll provide some general reasons why the weak* topology is useful, but there are so many other reasons I don't have the time to mention.
Let $X$ be a topological vector space. Then we can define the topological dual space,
$$ X^* = \{ f : X \rightarrow \mathbb R\, \text{ is linear and continuous} \}. $$
This makes sense as a set, and moreover it has a natural vector space structure by defining addition and scalar multiplication pointwise. But is it itself a topological vector space? Do we have a natural topology to endow it with?
One natural solution is to endow it with the weak* topology; whatever topology we endow $X^*$ with, we surely expect the evaluation functional $\hat x : X^* \rightarrow \mathbb R$ sending $f \mapsto f(x)$ is continuous for all $x \in X.$ Since the weak* topology is precisely the weakest topology for which this holds, it seems like a good starting point.
Also by the universal property, if $\tau$ is another topology on $X^*$ such that evaluations are continuous (e.g. $X$ is Banach and $\tau$ is the strong topology on the dual), then the identity map $(X,\tau) \rightarrow (X, w^*)$ is continuous; so any such topology $\tau$ also contains the weak* topology as a subset. So if we agree that evaluation functionals ought to be continuous, this is really the weakest topology we can put on $X^*$ that's reasonable.
Another interpretation of weak topologies is as the topology of pointwise convergence. It is known that for a general topological space $X,$ we have the space of maps $X \rightarrow \mathbb R,$ identified as the product ${\mathbb R}^X$ naturally admits the product topology. Moreover in this topology, $f_n \rightarrow f$ if and only if $f_n(x) \rightarrow f(x)$ for all $x \in X.$
The weak* topology is similar, but we only require this to hold amount continuous linear functionals. Going back to the case when $X$ is a TVS, the product space ${\mathbb R}^X$ is huge and difficult to work with, but $X^* \subset {\mathbb R}^X$ is a bit more manageable. But we do get a natural topology on $X^*$; we simply equip it with the subspace topology inherited from ${\mathbb R}^X.$ It turns out that this coincides with the weak* topology (essentially because the product topology itself is the weakest topology such that the projections are continuous), and so $X^*$ is also the topology of pointwise convergence (in the sense described above).
Admittedly this may convince you that this makes the weak* topology a natural choice to endow $X^*$ with, but it's not obvious why it's useful. This interpretation as a product topology has the benefit however, that you get nice compactness properties.
Tychonoff's theorem says that the product space $A^X$ is compact if $A$ is. Of course we can't simply take $A = \mathbb R$ as it is non-compact, but if we can find a subset $Y \subset X^*$ such that $Y \subset [a,b]^X$ and is closed with respect to suitable topologies, we get $Y$ is (appropriately) compact. It turns out that because the weak topology is suitably compatible with the product topology in $\mathbb R^X,$ we get nice compactness properties. In particular if $X$ is Banach, weak* closed and bounded subsets of $X^*$ are weak* compact.
Going back to a more concrete setting, in PDEs for example a common approach to finding solutions is to start with some sort of approximation, and extract some kind of limit. For this compactness is extremely useful, because you know any sequence will have a limit point. From there a common approach is to try and show said limit solves the PDE you were considering.
Other motivations I haven't included include their use in distribution theory (and more applications to PDEs), the relation between weak topologies and reflexivity, and probably a lot more that I can't think of right now.
Best Answer
For any $X$, the weak topology on $X$ is defined to be the coarsest topology that makes $x\mapsto f(x)$ continuous for each $f\in X^*$, the dual space of $X$. Equivalently it is the topology induced by the seminorms $x\mapsto|f(x)|$, and an open neighborhood of origin looks like $\{x\in X: |f_i(x)|\leq\epsilon,\forall\ 1\leq i\leq n \}$. More generally, weak topology makes sense whenever we have a pairing $(X,Y)$ of spaces, see the wiki article.
Now this definition works for any normed space, so in particular it also works for $X^*$: the weak topology on $X^*$ is the coarsest topology that makes $f\mapsto \chi(f)$ continuous for each $\chi\in X^{**}$, the dual space of $X^*$. However there is another natural topology on $X^*$, where we only consider those $\chi$ that comes from elements in $X$, namely we have an embedding $i:X\rightarrow X^{**},x\mapsto\chi_x$ where $\chi_x(f):=f(x)$. This is the weak* topology. In general the weak* topology is weaker than the weak topology on $X^*$, but if $i(X)=X^{**}$ then obviously they are the same (the converse is also true, see here)
The weak/weak* topology is much weaker than the norm topology. Every weak open neighborhood of origin is norm-unbounded. The closed unit ball of $X^*$ is compact in weak* topology (Alaoglu Theorem), while it is far from compact under the norm topology, unless $X$ is finite dimensional.
Hilbert space is an important special case. It is reflexive by Riesz representation theorem, so no need to distinguish weak and weak* topology. Say $(e_i)_{i=1}^\infty$ is an orthonormal basis for the Hilbert space $H$, so each $x\in H$ can be expanded as $x=\sum x_ie_i$, also denoted as $(x_1,x_2,x_3,...)$. Then on any norm-bounded set, weak topology is exactly componentwise convergence, i.e., a sequence $x^{(n)}$ converges to $y$ iff $x^{(n)}_i$ converges to $y_i$ for every $i$. This is a good exercise, you can also find it in this note. There is also an operator version.