Let us first fix the syntax errors in your two processes:
p1: process(clk)
begin
if clk = '1' then
q <= d;
end if;
end process;
p2: process(clk)
begin
if rising_edge(clk) then
q <= d;
end if;
end process;
In the first process q is assigned if and only if 1) there is an event (a value change) on clk, and 2) the new value of clk is '1'. So, the two processes are semantically equivalent if and only if rising_edge(clk) is true for all changes of clk with final value '1', and only these changes.
If the type of clk is bit it is the case and the two are semantically equivalent. Any VHDL simulator would behave the same. But see below for the difference between semantically equivalent and just equivalent.
If the type of clk is std_ulogic or std_logic, rising_edge(clk) is true for clk transitions from '0' or 'L' to '1' or 'H'. So the two processes are not semantically equivalent. In particular, a transition from 'X' (unknown value) or 'Z' (high impedance) or 'U' (uninitialized) to '1' is not considered as a rising edge, which makes sense. We could easily design a simulation environment that demonstrates the different behaviors.
But there is another aspect to consider: I used the term semantically equivalent and not just equivalent on purpose. Some logic synthesizers base D-flip-flop inference on syntax, not semantics. If you try, for instance, to synthesize process p1 where clk is of type bit with Vivado v2024.2 (64-bit) you will see in the logs:
WARNING: [Synth 8-614] signal 'd' is read in the process but is not in the sensitivity list
WARNING: [Synth 8-327] inferring latch for variable 'q_reg'
This is because Vivado expected one of the following syntaxes:
if clk'event and clk = '1' then
if rising_edge(clk) then
and did not consider the semantics, only the syntax. As a consequence it inferred a latch, instead of the D-flip-flop you expect, and that it would infer with process p2. This is why your teacher told you that q would keep updating when d changes. To be more accurate they should have told you "with some synthesizers, after synthesis, q would keep updating when d changes while clk = '1'". This is how a latch works: it is transparent on the enabling level of the clock.
So, if you want your design to be synthesized as a D-flip-flop, you must use the syntax that your synthesizer expects. And as rising_edge(clk) is common to bit, std_ulogic, std_logic, and all synthesizers support it, the best is to use that.
Note that if clk'event and clk = '1' then is also supported by all synthesizers I know but remember that it is not semantically equivalent to if rising_edge(clk) then. Here too you could easily design a simulation environment that demonstrates the different behaviors.