The difference is which extremes they are built on: bullish on two lows, bearish on two highs. The name refers to the type of extreme, not to a forecast.
The exact conditions
Two adjacent confirmed extremes of the same type are compared, along with the indicator's values in those same bars.
Bearish. Price prints a higher high while the indicator reads lower at that high. In shorthand: price HH, indicator LH.
Bullish. Price prints a lower low while the indicator reads higher. That is: price LL, indicator HL.
Both conditions are best checked against a threshold rather than bare sign: without one, any flutter in the hundredths would produce a divergence at every pair of peaks. What the threshold should be depends on the indicator — RSI has its own scale in points, the MACD histogram is a quantity in prices.
Why "bullish" sits on lows
The naming logic runs like this: at the lows price is still falling while the indicator is not, so the downward impulse is weaker than the previous one by this indicator's measure. Hence "bullish".
But that is about impulse, not about what comes next. A weakening impulse can keep weakening for a long time while the trend carries calmly on.
What has to line up by bar
The indicator's value is read at the pivot itself, not at an arbitrary point — with a small tolerance in time. If the indicator has no extreme exactly at the peak's bar, the nearest one is used.
The tolerance is needed because the indicator is smoothed and its own peak is almost always slightly offset from the price peak. Without it a substantial share of genuine divergences would be lost; with too much of it, distinct peaks start merging.
Distance between peaks
A pair of extremes is worth considering only when they are neither too close together nor too far apart. Right next to each other is one extreme smeared by noise; at opposite ends of the chart is two unrelated stretches, between which a divergence describes nothing.
What it does not mean
Neither bullish nor bearish divergence is an entry signal, and neither is used as one here. It is a property of a stretch: the current move's impulse is weaker than the previous one by the chosen indicator's measure. Everything beyond that is interpretation, and not ours.