The answer is n=2022.
First, we will prove that n≥2022. We denote the square in the ith row and the jth column as (i,j). When the piece in (i,j) is moved to (i′,j′) in a single operation, it holds that i′=i+1 and ∣j′−j∣≤1. Thus, in order to move the piece from (a,b) to (c,d) in some operations, it requires that a≤c and ∣d−b∣≤c−a. If Bob places the piece in (1,1) and designates (n,2021) as the goal, then ∣2021−1∣≤n−1 yields n≥2021.
For n=2021, if Bob places the piece in (1,1) and designates (2021,2021) as the goal, then Alice has to move the piece from (k,k) to (k+1,k+1) for any 1≤k≤2020. Hence she has to color any (k,k) black. In this situation, we can show that she cannot move the piece from (1,1) to (k+1,k) for any 1≤k≤2020, and specifically to (2021,2020), which yields n≥2022. The proof follows from induction on k. For k=1 this claim holds since (1,1) is colored black. For k≥2, note that she can move the piece to (k+1,k) only from (k,k−1), (k,k), or (k,k+1). Here, as ∣(k+1)−1∣>k−1, she cannot move from (1,1) to (k,k+1). Also, she cannot move to (k,k−1) by the induction hypothesis. Additionally, as (k,k) is colored black, she cannot move from that square to (k+1,k).
Conversely, we will prove that Alice can move the piece to the goal when n=2022. First, she colors the squares (i,j) with i≥4 black. Then, for any odd integers a,b with 3≤a≤2019 and 1≤b≤2021, she can move the piece from (4,a) to (2022,b). Similarly, for any even integers a,b with 2≤a,b≤2022, she can move the piece from (4,a) to (2022,b).
Next, for the squares (i,j) with 1≤i≤3, she colors the following form of squares black for any k with 0≤k≤336:
(1,3k+1),(1,2021−3k),(1,3k+3),(1,2019−3k),(2,3k+2),(2,2020−3k),(3,3k+1),(3,2021−3k)
And she colors the remaining squares white. Note that for k=336, (1,3k+3) and (1,2019−3k) are the same squares. In this situation, we prove that Alice can move the piece to the goal. From the symmetry of this coloring, we only need to prove that she can move from (1,a) with 1≤a≤1011 to any squares in the bottom row. For k with 0≤k≤336, she can move from (1,3k+1), (1,3k+2), or (1,3k+3) to (2,3k+2), then through (3,3k+1) or (3,3k+3), she can move to (4,3k+2) or (4,3k+3). Hence, she can move from (1,a) to any squares in the bottom row. This completes the proof.