Norling:
The IRF520 has a Vgs of 2-4V so I tought that would work. We used it at school with a 5V logic level and that worked flawlessly.
I'm using an infiduino uno r3 which has a 3.3V logic level
Well, it turns out, there's a huge difference between 5V logic and 3.3V logic, in this instance. Notice that the voltage range you referenced has a high of 4V. That's above 3.3V. Also, that's the VGS(th) [Gate Threshold Voltage] which is a poor measure of the switching qualities of a MOSFET. This device isn't really, even, a "Logic Level" device -- which really means, the manufacturer never said this will work at Logic Levels.
In other-other words: The advertized functionality [for instance, at the top of the datasheet] is not guaranteed for voltages below 10V [which is the "test voltage" stipulated throughout the datasheet]. Often the channel resistance and/or typical current handling ability includes a Gate Voltage, but not on the datasheet I looked at -- but you can infer this by noticing those little notations, like "VGS @ 10V" or "Note 3", etc., later in the datasheet.
Yes, it will work at 5V logic for currents below a certain point--which is probably why your school room experience was so sweet
BUT, try that at 9.7A! I dare ya!! 
And, at 3.3V you have a whole 'nother can of worms. 3.3V, as I stated before, is below the upper gate threshold range [sure, you might get lucky and score a device with a gate threshold down closer to 2V, and get a warm-fuzzy]. The gate threshold is the point where the MOSFET will just begin to conduct. That is NOT a very good definition of "On"--in fact, it's more of a definition of "Off".
In the datasheet [Infineon, in my case], if you scroll down to the graphs, and look at the two "Typical Output Characteristics" graphs, the lowest Gate Voltage the manufacturer will commit to, is 4.5V -- that's a whopping 1.2V above "3.3V" -- but, notice that, worst case, 5V on the gate will only allow around 2A to flow through the channel -- so for some situations, that could be considered "On". But, there is no manufacturer recognized On state for when there is 3.3V on the gate.
Also, if you look at the "Typical Transfer Characteristics" graph, you'll see that 4V is the lowest Gate voltage on the graph -- so 3.3V isn't even recognized as a valid case! Sometimes, there is also a graph that relates channel resistance to gate voltage, but that's absent from the datasheet I looked at.