The speeds are charted at waypoints and they apply when you cross that waypoint. On a departure, the restriction applies until crossing the waypoint but no longer applies afterwards - though another restriction at a later waypoint would apply. On an arrival, the reverse is true: fly whatever speed until the first restriction, then comply with that at & after the point.
The typical phrasing on US departure procedures is "do not exceed XXX knots until past YYYYY waypoint" - which rules out speeding up & then slowing down just for the waypoint. The reason behind this is that ATC wants to control the flow & separation of aircraft, and points provide "gates" to do that: everybody holds (no more than) 220 knots until "here", then (no more than) 240 knots until "here", and then normal climb speed after that.
The same logic applies on arrivals, with the defined points as places where the flow of traffic slows down in a uniform, predictable manner.
The general practice (which may or may not be codified in a given AIP or SOP) is that you want to get fast as soon as allowed (i.e. on departures), and stay as fast as possible for as long as allowed (on arrivals). So, on the top chart, you'd expect to slow to 240 so as to cross CRL at that speed, but no earlier. Then start slowing about 2 miles prior to BU214 so as cross it at 220, having held 240 until then. Sometimes it's necessary to slow sooner than this & be below the published maximum speeds in order to comply with subsequent restrictions - and that's fine since they're max speeds, not "at" speeds. But the most general case is that you'll get fast as quickly as allowed & stay fast as long as allowed. But not in a manner where you slow back down on a departure, nor speed back up on an arrival - unless the controller clears you for it (which is pretty uncommon).